[R] combining two different matrizes

Berend Hasselman bhh at xs4all.nl
Thu Jun 6 17:20:41 CEST 2013


On 06-06-2013, at 17:04, David Carlson <dcarlson at tamu.edu> wrote:

> You didn't give us data, but this may give you enough to solve your problem:
> 
>> set.seed(42)
>> nrows <- 6
>> ncols <- 5
>> mat1 <- matrix(sample.int(100, 30), nrows, ncols)
>> mat1
> …..
>> newmat <- matrix(rbind(as.vector(mat1), as.vector(mat2)), nrows*2, ncols)

Nice.

Berend



More information about the R-help mailing list