[R] creating cubes

Matteo Richiardi matteo.richiardi at gmail.com
Fri Jan 15 23:20:23 CET 2016


What is the best way to store data in a cube? That is, I need to create a
data structure D with three indexes, say i,j,h, so that I can access each
data point D[i,j,h], and visualise sections like D[i,j,] or D[,,h].

I have tried to create an array of matrixes:

D <-matrix(matrix(NA,i,j),h)

but then D[i] returns a number, and not a matrix.

I imagine this is a dummy question, but I did search for an answer on
various R help sites, and found nothing straightforward. Being an
inexperienced R user, I prefer a simple solution, even at some efficiency
cost.

Many thanks for your help.
Matteo

	[[alternative HTML version deleted]]



More information about the R-help mailing list