View source: R/hoff_functions.R
arrIndices | R Documentation |
Generates indices corresponding to subarrays.
arrIndices(saidx)
saidx |
either a vector of the dimensions of a potential array, or a list of the indices in the subarray. |
This function generates a matrix corresponding to all combinations of a list of indices, to be used in subsetting arrays.
Peter Hoff.
# all indices of an array arrIndices(c(4, 3, 2)) # indices of a subarray arrIndices(list(c(1, 3), c(4, 5), c(2, 3, 6)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.