Re: [R] Selecting from matrix and then stacking in array.

2011-09-20 Thread Kristian Lind
Thank you. It works great. Kristian 2011/9/16 R. Michael Weylandt > I think changing nrow() to NROW() will get around that error. However, > this, as you can see, this goes a little astray at the end. Perhaps > something like this will work for you: > > z.ext <- rbind(z,array(0,c(9,3))) > z.out

Re: [R] Selecting from matrix and then stacking in array.

2011-09-16 Thread R. Michael Weylandt
I think changing nrow() to NROW() will get around that error. However, this, as you can see, this goes a little astray at the end. Perhaps something like this will work for you: z.ext <- rbind(z,array(0,c(9,3))) z.out <- array(0, c(3,3,9)) for(i in 1:9){ z.out[,,i] <- cbind(z.ext[c(i,i+3,i+6),