Re: [R] Transpose array

2009-02-24 Thread Peter Dalgaard
MarcioRibeiro wrote: Hi Listers, Is there a way that I can transpose an array... Suppose I have the following array... x<-array(c(1,2,3,4),dim=c(1,2,2)) , , 1 [,1] [,2] [1,]12 , , 2 [,1] [,2] [1,]34 And I would like to get the following result... , , 1 [,1] [1,]

Re: [R] Transpose array

2009-02-24 Thread Greg Snow
Try aperm(x, c(2,1,3)) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of MarcioRibeiro > Sent: Tuesday, Februar