[R] Stacking matrices

Benilton Carvalho beniltoncarvalho at gmail.com
Mon Mar 15 18:42:02 CET 2010


how about

y = X[rep(1:nrow(X), 6), ]

?

On Mon, Mar 15, 2010 at 5:37 PM,  <JLucke at ria.buffalo.edu> wrote:
> What is an easy way to stack a matrix multiple times?  E.g.  I have a 6x6
> matrix that I need to stack vertically 154 times to get a 6*154 by 6
> matrix.  I would rather not rbind(X,X,...,X) matrices.    --Joe
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list