Re: [R] cbind 3 or more matrices

2011-06-04 Thread Jim Silverton
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@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] cbind 3 or more matrices

2011-06-04 Thread Sarah Goslee
do.call(cbind, list(A, B, C)) On Sat, Jun 4, 2011 at 7:14 PM, Jim Silverton jim.silver...@gmail.com wrote: How can I cbind three or more matrices like A,B and C. This does not work: cbind(A,B,C) -- Thanks, Jim. -- Sarah Goslee http://www.functionaldiversity.org

Re: [R] cbind 3 or more matrices

2011-06-04 Thread baptiste auguie
A, B, C should have the same number of rows. mlist = replicate(3, matrix(rnorm(6), 2), simplify=FALSE) names(mlist) = LETTERS[seq_along(mlist)] with(mlist, cbind(A,B,C)) or, do.call(cbind, mlist) HTH, baptiste On 5 June 2011 11:14, Jim Silverton jim.silver...@gmail.com wrote: How can I

Re: [R] cbind 3 or more matrices

2011-06-04 Thread Phil Spector
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,]