Re: [R] array to matrix or data.frame

2009-09-27 Thread Daniel Malter
Works a charme; thanks much everybody. Daniel. David Winsemius wrote: > > > On Sep 27, 2009, at 6:33 PM, Daniel Malter wrote: > >> >> Hi, I have an array of dimension 6:6:16. I want to stack the >> 16 >> slices of the array into a matrix or a data frame of dimension >> 6:(6*16=9

Re: [R] array to matrix or data.frame

2009-09-27 Thread Rolf Turner
On 28/09/2009, at 11:51 AM, David Winsemius wrote: apply(x, 2 , I) ***Much*** sexier than my solution! cheers, Rolf Turner ## Attention:\ This e-mail message is privileged and co

Re: [R] array to matrix or data.frame

2009-09-27 Thread Gabor Grothendieck
Try this: matrix(aperm(x, c(1,3,2)), nc = 6) On Sun, Sep 27, 2009 at 6:33 PM, Daniel Malter wrote: > > Hi, I have an array of dimension 6:6:16. I want to stack the 16 > slices of the array into a matrix or a data frame of dimension > 6:(6*16=96) in order to write it to a csv fil

Re: [R] array to matrix or data.frame

2009-09-27 Thread David Winsemius
On Sep 27, 2009, at 6:33 PM, Daniel Malter wrote: Hi, I have an array of dimension 6:6:16. I want to stack the 16 slices of the array into a matrix or a data frame of dimension 6:(6*16=96) in order to write it to a csv file. It seems I cannot get the matrix or data.frame f