Lapointe, Pierre
2006-Jul-19 12:45 UTC
[R] How would you export a 3-dimensional array to an SQL database?
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}}
Neuro LeSuperHéros
2006-Jul-19 15:23 UTC
[R] How would you export a 3-dimensional array to an SQL database?
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" <Pierre.Lapointe at nbf.ca> >To: "'r-help at stat.math.ethz.ch'" <r-help at stat.math.ethz.ch> >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}} > >______________________________________________ >R-help at stat.math.ethz.ch 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.