[R] rbind, array

Gabor Grothendieck ggrothendieck at gmail.com
Sun Jul 16 21:25:08 CEST 2006


Try this:

y <- array(1:27, c(3, 3, 3))   # test array
rbind(y[,,1], y[,,2], y[,,3])
apply(y, 2, I)

# verify that last two lines give same result
identical(apply(y, 2, I), rbind(y[,,1], y[,,2], y[,,3]))  # TRUE

On 7/16/06, Robert Mcfadden <robert-mcfadden at o2.pl> wrote:
> Hello,
>
> I'm looping something like rbind for array. More precisely: if I define
>
> y<-array(c(1:27),dim=c(3,3,3)) and I take 3 matrix: y[,,1], y[,,2], y[,,3]
> and write rbind(y[,,1], y[,,2], y[,,3]) I get what I want. But what if I
> have hundreds such matrix. How to do it.
>
> Robert
>
>
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



More information about the R-help mailing list