Subset a space by sample indices
Usage
space_subset(space, idx, pack = FALSE)
Arguments
- space
A gds_space object
- idx
Integer or logical index for the sample axis
- pack
Logical; when TRUE and space is a dense voxel space, return a
packed voxel space using idx as the new mask indices.
Value
A new space object with samples restricted
Examples
sp <- space_parcels(letters[1:5])
space_subset(sp, 2:4)
#> $type
#> [1] "parcels"
#>
#> $labels
#> [1] "b" "c" "d"
#>
#> $lookup
#> NULL
#>
#> $membership
#> NULL
#>
#> attr(,"class")
#> [1] "Space" "space_parcels" "gds_space"