[R] Putting the same array into a matrix

Desmond Lim limwenpin at gmail.com
Thu Oct 14 17:25:47 CEST 2010


Hi,

I have an array and I want to put in into a matrix x number of times. Currently I doing this

matrix <- cbind(array, array, array).

Is there a more elegant way of doing this?

I've tried

matrix <- cbind(rep(array, times=x)) and matrix <- rep(cbind(array), times = 5)

but it didn't work.

Thanks.


More information about the R-help mailing list