> "RB" == Rui Barradas
> on Tue, 12 Nov 2013 18:52:31 + writes:
RB> Hello,
RB> Maybe using ?Reduce:
RB> Zlist <- c(mat1, mat2, mat3)
RB> Z <- Reduce(cbind2, Zlist)
RB> Ztmp <- cbind2(mat1, mat2)
RB> Z2 <- cbind2(Ztmp, mat3)
RB> identical(Z, Z2) # T
Hi,
Try:
Reduce(function(...) cbind2(...),Zlist)
A.K.
Suppose I have three matrices, such as the following:
mat1 <- Matrix(rnorm(9), 3)
mat2 <- Matrix(rnorm(9), 3)
mat3 <- Matrix(rnorm(9), 3)
I now need to column bind these and I could do the following if
there were only two of those mat
Hello,
Maybe using ?Reduce:
Zlist <- c(mat1, mat2, mat3)
Z <- Reduce(cbind2, Zlist)
Ztmp <- cbind2(mat1, mat2)
Z2 <- cbind2(Ztmp, mat3)
identical(Z, Z2) # TRUE
Also, I prefer list(mat1, mat2, mat3), not c().
Hope this helps,
Rui Barradas
Em 12-11-2013 17:20, Doran, Harold escreveu:
Sup
Suppose I have three matrices, such as the following:
mat1 <- Matrix(rnorm(9), 3)
mat2 <- Matrix(rnorm(9), 3)
mat3 <- Matrix(rnorm(9), 3)
I now need to column bind these and I could do the following if there were only
two of those matrices because cbind2() has an x and y argument
Zlist <- c(mat
4 matches
Mail list logo