subset-methods {Cardinal} | R Documentation |
Returns a subset of the dataset that meets the conditions.
## S4 method for signature 'SparseImagingExperiment' subset(x, subset, select, ...) subsetFeatures(x, ...) subsetPixels(x, ...)
x |
An imaging dataset. |
subset |
Logical expression to be evaluated in the object's |
select |
Logical expression to be evaluated in the object's |
... |
Conditions describing rows (features) or columns (pixels) to be retained. Passed to |
An object of the same class as x
with the appropriate subsetting applied to it.
Kylie A. Bemis
set.seed(1) mse <- simulateImage(preset=1, npeaks=10, dim=c(10,10)) # subset features to mass range 1000 - 1500 subsetFeatures(mse, 1000 < mz, mz < 1500) # select pixels to coordinates x = 1..3, y = 1..3 subsetPixels(mse, x <= 3, y <= 3) # subset both features + pixels subset(mse, 1000 < mz & mz < 1500, x <= 3 & y <= 3)