Here's a way to flatten and unflatten your array. a <-array(1:24, 2:4) d <-dim(a)
flattened <-cbind(expand.grid(1:d[1],1:d[2],1:d[3]),as.vector(a)) unflattened <-array(flattened[,4],d) identical(a,unflattened) a==unflattened NeuroRox >From: "Lapointe, Pierre" <[EMAIL PROTECTED]> >To: "'[email protected]'" <[email protected]> >Subject: [R] How would you export a 3-dimensional array to an SQL database? >Date: Wed, 19 Jul 2006 08:45:42 -0400 > >Hello, > >How would you export a 3-dimensional array to an SQL database? > >a<-array(1:24, 2:4) > >Is there an open source DB that would be more adequate for this type of >operation? > >Is there a way to reshape/flatten a 3-dimensional array? > >Regards, > >Pierre Lapointe > >************************************************** >AVIS DE NON-RESPONSABILITE: Ce document transmis par courrie...{{dropped}} > >______________________________________________ >[email protected] 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. ______________________________________________ [email protected] 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.
