SpatialExperiment-subset {SpatialExperiment} | R Documentation |
The subsetting method for SpatialExperiment
objects ensures
that spatial data attributes (spatialData
,
spatialCoords
, imgData
) are subsetted correctly
to match rows and columns with the remainder of the object.
x |
a |
i |
row indices for subsetting |
j |
column indices for subsetting |
a SpatialExperiment
object
[
:subsetting method
example(read10xVisium) dim(spe) set.seed(123) idx <- sample(ncol(spe), 10) sub <- spe[, idx] dim(sub) spatialData(sub, spatialCoords = TRUE, colData = TRUE)