Re: [R] store matrix in an arrary

2010-09-27 Thread Jorge Ivan Velez
Hi Wesley, Try this (untested): s <- array(0, dim = c(2, 2, 4)) for(i in 1:4) s[, ,i] <- read_matrix(a, 2, 2) Another (untested) option wold be s0 <- lapply(1:4, function(i) read_matrix(a, 2, 2)) s0 HTH, Jorge On Mon, Sep 27, 2010 at 6:12 AM, wesley mathew <> wrote: > Dear All > > I w

Re: [R] store matrix in an arrary

2010-09-27 Thread Edwin Groot
On Mon, 27 Sep 2010 11:12:26 +0100 wesley mathew wrote: > Dear All > > I want to store matrix in an array > Suppose s<-array(0,4) > for(i in 1:4) > s[i] <- read_matrix(a,2,2) > But the error - number of items to replace is not a multiple of > replacement > length. > Can you suggest me any alter

[R] store matrix in an arrary

2010-09-27 Thread wesley mathew
Dear All I want to store matrix in an array Suppose s<-array(0,4) for(i in 1:4) s[i] <- read_matrix(a,2,2) But the error - number of items to replace is not a multiple of replacement length. Can you suggest me any alternative method for storing a matrix in an array. Thanks In advance. Kind Regard