Description Usage Arguments Value Note Author(s) References Examples
View source: R/arrayExtractor.R
Uses a list
of the same length as the dimensions of an array to extract
information, similar to using matrix indexing.
1 | arrayExtractor(inarray, valslist)
|
inarray |
The input array. |
valslist |
A list of vectors to use to extract data. A value of |
An array.
The list
used for valslist
must be the same length as the number of
dimensions in the array. It must also be specified in the same order as you
would normally reference the dimensions of an array. For instance, in the
example, the array has row dimensions, column dimensions, and a third
dimension.
Ananda Mahto
http://stackoverflow.com/q/34795331/1270695
1 2 3 4 5 6 7 8 | my_array <- structure(1:12, .Dim = c(2L, 3L, 2L),
.Dimnames = list(c("D_11", "D_12"),
c("D_21", "D_22", "D_23"), c("D_31", "D_32")))
my_array
arrayExtractor(my_array, list("D_11", NULL, NULL))
arrayExtractor(my_array, list(NULL, "D_21", "D_32"))
arrayExtractor(my_array, list(NULL, c("D_21", "D_22"), NULL))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.