sub-xcmsRaw-logicalOrNumeric-missing-missing-method: Subset an xcmsRaw object by scans

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Subset an xcmsRaw object by scans. The returned xcmsRaw object contains values for all scans specified with argument i. Note that the scanrange slot of the returned xcmsRaw will be c(1, length(object@scantime)) and hence not range(i).

Usage

1
2
## S4 method for signature 'xcmsRaw,logicalOrNumeric,missing,missing'
x[i, j, drop]

Arguments

x

The xcmsRaw object that should be sub-setted.

i

Integer or logical vector specifying the scans/spectra to which x should be sub-setted.

j

Not supported.

drop

Not supported.

Details

Only subsetting by scan index in increasing order or by a logical vector are supported. If not ordered, argument i is sorted automatically. Indices which are larger than the total number of scans are discarded.

Value

The sub-setted xcmsRaw object.

Author(s)

Johannes Rainer

See Also

split.xcmsRaw

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Load a test file
file <- system.file('cdf/KO/ko15.CDF', package = "faahKO")
xraw <- xcmsRaw(file)
## The number of scans/spectra:
length(xraw@scantime)

## Subset the object to scans with a scan time from 3500 to 4000.
xsub <- xraw[xraw@scantime >= 3500 & xraw@scantime <= 4000]
range(xsub@scantime)
## The number of scans:
length(xsub@scantime)
## The number of values of the subset:
length(xsub@env$mz)

anupbharade09/xcms_test documentation built on May 14, 2019, 4:07 a.m.