take | R Documentation |
Take a subset along an arbitrary dimension
take(x, along, indices, drop = FALSE)
x |
matrix or array to subset |
along |
dimension to subset along |
indices |
the indices to select |
drop |
should the dimensions of the array be simplified? Defaults
to |
x <- array(seq_len(3 * 4 * 5), c(3, 4, 5))
take(x, 3, 1)
take(x, 2, 1)
take(x, 1, 1)
take(x, 3, 1, drop = TRUE)
take(x, 2, 1, drop = TRUE)
take(x, 1, 1, drop = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.