Re: [R] How would you export a 3-dimensional array to an SQL database?

From: Neuro LeSuperHéros <neuro3000_at_hotmail.com>
Date: Thu 20 Jul 2006 - 01:23:17 EST


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@nbf.ca>
>To: "'r-help@stat.math.ethz.ch'" <r-help@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@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.



R-help@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. Received on Thu Jul 20 02:39:27 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 20 Jul 2006 - 04:17:43 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.