[R] cbind 3 or more matrices

Phil Spector spector at stat.berkeley.edu
Sun Jun 5 01:29:34 CEST 2011


Jim -
    In what sense does cbind(A,B,C) not work?

> A = matrix(rnorm(10),5,2)
> B = matrix(rnorm(15),5,3)
> C = matrix(rnorm(20),5,4)
> cbind(A,B,C)
             [,1]       [,2]      [,3]         [,4]       [,5]        [,6]
[1,] -0.54194873 -1.1105170 -0.479010  0.619911163  0.1610162  0.49028633
[2,] -0.39289246  0.0752089  1.427386 -0.921868090 -0.7637016 -0.34905125
[3,] -0.07082828 -0.1060497 -1.007713 -0.003673573 -0.8384406 -0.88816295
[4,]  0.22733701 -1.6134894 -1.993654  2.277865363 -2.3599239 -0.21704046
[5,] -0.13809337  0.3443488 -1.384425  0.132130433  0.1345938 -0.04170648
            [,7]       [,8]        [,9]
[1,] -1.7481451  0.4467964 -0.41358420
[2,] -0.2882922  1.0243662 -0.48263684
[3,]  0.9402479  0.5467952 -0.01922035
[4,]  0.6795783  1.4560765 -0.23013826
[5,]  0.9800312 -1.3462175 -0.77064872

 					- Phil Spector
 					 Statistical Computing Facility
 					 Department of Statistics
 					 UC Berkeley
 					 spector at stat.berkeley.edu


On Sat, 4 Jun 2011, Jim Silverton wrote:

> How can I cbind three or more matrices like A,B and C. This does not work:
>
> cbind(A,B,C)
>
>
> -- 
> Thanks,
> Jim.
>
> 	[[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