Extracts a subset from a tensor. You can also use the [ operator.
Supports R-style indexing including scalar indices (which drop dimensions),
ranges (a:b), and list() for selecting multiple elements along a
dimension.
Usage
# S3 method for class 'AnvilBox'
x[...]
# S3 method for class 'AnvilTensor'
x[...]
nv_subset(x, ...)Arguments
- x
(
tensorish)
Tensor to subset.- ...
Subset specifications, one per dimension. Omitted trailing dimensions select all elements. Seevignette("subsetting")for details.
See also
nv_subset_assign() for updating subsets, vignette("subsetting")
for a comprehensive guide.