aperm(array(dat,c(10,10,2)),c(1,3,2)) --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnew...@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity.
Hans Thompson <hans.thomps...@gmail.com> wrote: >If I have a two column data frame like: > >> dat <- cbind("x"=c(1:100),"y"=c(100:1)) > >How can I create an array that splits every ten rows of that data frame >into a third dimension of an array so that: > >> newarray[,,1] > >,,1 > >x y >1 100 >2 99 >3 98 >... ... >10 91 > > >,,2 > >x y >11 90 >12 89 >... ... > > >... > >Thanks. > > [[alternative HTML version deleted]] > >______________________________________________ >R-help@r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.