| SpatialExperiment-colData {SpatialExperiment} | R Documentation |
The SpatialExperiment class provides a modified colData
setter, which ensures that the SpatialExperiment object remains valid.
## S4 replacement method for signature 'SpatialExperiment,DataFrame' colData(x) <- value ## S4 replacement method for signature 'SpatialExperiment,'NULL'' colData(x) <- value
x |
|
value |
The colData setter performs several checks to ensure validity. If the
replacement colData does not contain a sample_id column, the
existing sample_ids will be retained. If the replacement
colData contains sample_ids, a check is performed to ensure the
number of unique sample_ids is the same, i.e. a one-to-one mapping is
possible. If the replacement is NULL, the sample_ids are
retained. In addition, checks are performed against the sample_ids in
imgData.
a SpatialExperiment object with updated colData
example(read10xVisium) colData(spe) <- NULL