Hi,
I would like to add rows to arbitrary tables within a 3dimensional array.
I can directly add data to an existing row of a table:
> x <- array(0,c(1,3,2))> x[,,1] <- c(1,2,3)
And I can even add a row to the table and assign to another object.
> y <- rbind(x[,,1], c(4,5,6))
and 'y' is what I want it to be:> y     [,1] [,2] [,3][1,]    1    2   3[2,]    
4    5   6
but I can't do this within the 3dimensional array:
> x[,,1] <- rbind(x[,,1], c(4,5,6))Error in x[, , 1] <- rbind(x[, , 1], c(4, 5, 
> 6)) :   number of items to replace is not a multiple of replacement length
Does anyone know I can add rows to one of tables within the array?
Thanks.

                                          
_________________________________________________________________
Hotmail: Free, trusted and rich email service.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to