slice | R Documentation |
Performs the same role as selecting with subscripts except that this is easier to use when dimension of the array is not known. Its application is limited, however, to selecting single slices along a single dimension.
slice(a, MARGIN, ind)
a |
an array |
MARGIN |
a single dimension along which to select a slice (i.e. a section) |
ind |
the level at which to select the slice. If ind is out of range, slice returns NAs with the correct structure |
Titanic
slice(Titanic, 1, 1)
slice(slice(Titanic, 1, 1), 1, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.