parkbomee
2009-Dec-12 22:36 UTC
[R] multi-dimensional array with different number of dimensions?
Hi, Is it possible to assign to an array with different dimensions? That is to say, supposing a three dimensional array, the third dimension of the array has matrices of different sizes?> array, , 1 [1] [2] [3] [1] 1 1 1 , , 2 [1] [2] [3] [1] 1 1 1 [2] 1 1 1 , , 3 [1] [2] [3] [1] 1 1 1 [2] 1 1 1 [3] 1 1 1 something like this?? Thanks, B _________________________________________________________________ [[alternative HTML version deleted]]
David Winsemius
2009-Dec-12 23:20 UTC
[R] multi-dimensional array with different number of dimensions?
On Dec 12, 2009, at 5:36 PM, parkbomee wrote:> > Hi, > > Is it possible to assign to an array with different dimensions? > That is to say, supposing a three dimensional array, > the third dimension of the array has matrices of different sizes?Use a list. Or populate with NA's> >> array > , , 1 > [1] [2] [3] > [1] 1 1 1 > > > , , 2 > [1] [2] [3] > > [1] 1 1 1 > > [2] 1 1 1 > > , , 3 > [1] [2] [3] > > > [1] 1 1 1 > > > [2] 1 1 1 > > > [3] 1 1 1 > > > something like this?? > > > Thanks, > B > > _________________________________________________________________ > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.David Winsemius, MD Heritage Laboratories West Hartford, CT