Displaying 1 result from an estimated 1 matches for "arraytak".
Did you mean:
arraytake
2006 Oct 19
2
arraytake for extracting subarrays from multidimensional arrays
...useful. I haven't completely robustified it
against all kinds of pathological inputs, but if there is any interest from
the development team it would be nice to add an error-checked version of
this to R (or I guess I could keep it in a package).
Simple usage example:
------
> source("arraytake.R")
> a <- array(1:24,c(2,3,4))
> a[,1:3,c(4,2)] ##This invocation requires hard coding the number of
dimensions of a
, , 1
[,1] [,2] [,3]
[1,] 19 21 23
[2,] 20 22 24
, , 2
[,1] [,2] [,3]
[1,] 7 9 11
[2,] 8 10 12
> arraytake(a,list(NULL,1...