SpatialExperiment-subset: Subsetting SpatialExperiment objects

SpatialExperiment-subsetR Documentation

Subsetting SpatialExperiment objects

Description

The subsetting method for SpatialExperiment objects ensures that spatial data attributes (spatialCoords and imgData) are subsetted correctly to match rows and columns with the remainder of the object.

Arguments

x

a SpatialExperiment object

i

row indices for subsetting

j

column indices for subsetting

Value

a SpatialExperiment object

subset

[:

subsetting method

Examples

example(SpatialExperiment)

dim(spe)

set.seed(123)
idx <- sample(ncol(spe), 10)
sub <- spe[, idx]
dim(sub)
colData(sub)
spatialCoords(sub)

drighelli/VisiumExperiment documentation built on June 30, 2024, 10:55 a.m.