[R] reverse array indexing

Buchsbaum, Brad (NIH/NIMH) BuchsbaB at intra.nimh.nih.gov
Wed Jul 30 22:42:59 CEST 2003



Hi,

Suppose I have a multidimensional array:

tmp <- array(1:8, c(2,2,2))

is there a function out there that, given a one-dimensional array index,
will
return the separate indices for each array dimension?

for instance, tmp[8] is equivalent to tmp[2,2,2]. I'd like to derive the
vector (2,2,2)
from the index 8. 

thanks,

Brad Buchsbaum




More information about the R-help mailing list