subset-methods: Subsetting

Description Usage Arguments Value Author(s) Examples

Description

Returns a subset of the dataset that meets the conditions.

Usage

1
2
3
4
5
6
## S4 method for signature 'SparseImagingExperiment'
subset(x, subset, select, ...)

subsetFeatures(x, ...)

subsetPixels(x, ...)

Arguments

x

An imaging dataset.

subset

Logical expression to be evaluated in the object's featureData() indicating which rows (features) to keep.

select

Logical expression to be evaluated in the object's pixelData() indicating which columns (pixels) to keep.

...

Conditions describing rows (features) or columns (pixels) to be retained. Passed to features() and pixels() methods to obtain the subset indices.

Value

An object of the same class as x with the appropriate subsetting applied to it.

Author(s)

Kylie A. Bemis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

Cardinal documentation built on Nov. 8, 2020, 11:10 p.m.