sampleAndSampleSet {rtms} | R Documentation |
Functions for creating and manipulating samples and sample sets
Description
Select a subset of a sample set (returns an rtmsSampleSet
)
Usage
## S3 method for class 'rtmsSampleSet'
x[i, ...]
## S3 method for class 'rtmsSampleSet'
x[[i, ...]]
## S3 replacement method for class 'rtmsSampleSet'
x[[i]] <- value
## S3 method for class 'rtmsSampleSet'
rep(x, ...)
## S3 method for class 'rtmsSample'
rep(x, ...)
Arguments
x |
An object of class |
i |
A single numeric index of the sample set |
... |
Included for S3 compatibility |
value |
An object of class |
Details
The sample (class rtmsSample
) and sample set (class rtmsSampleSet
)
objects are the core structures used to extract meaningful data from mass
spectographic data. In general, samples and sample sets will be created
automatically from other RTMS objects (such as readers or spectra) but in
the event that one wishes to manipulate them directly, it is important to
understand several details about how they work.
In terms of the data it contains, an object of class rtmsSample
is just a
list of smaller objects (of class rtmsSubsample
); however, each of these
subsamples corresponds to an rtmsPeak
object that was used to extract it;
the rtmsSample
object therefor has a "peaks" attribute, which is a list of
objects of class rtmsPeak
corresponding to the subsamples in the
rtmsSample
object. This attribute is used to determine how measurements
of the sample are reported and how the sample is plotted.
Similarly, the data contained in an object of class rtmsSampleSet
is just
a list of rtmsSample
objects but with an important difference. If many
rtmsSample
objects were arranged into a list, there would be no guarantee
that they contain measurements of the same peaks; such guarantees are
essential for plotting sample sets together or constructing extracted ion
chromatograms. The rtmsSampleSet
therefore strips the "peaks" attribute
from its individual members, and applies a single shared "peaks" attribute
to the entire sample set. Further samples can only be added to the sample
set if their peaks attributes are deemed compatible.
Value
An object of class rtmsSampleSet
An object of class rtmsSample
An object of class rtmsSampleSet
An object of class rtmsSampleSet
An object of class rtmsSampleSet
Functions
-
[[
: Select a single element of a sample set (returns anrtmsSample
) -
`[[`(rtmsSampleSet) <- value
: Insert a sample into a sample set -
rep(rtmsSampleSet)
: Repeat a sample set multiple times -
rep(rtmsSample)
: Create a sample set by repeating a single sample (returns anrtmsSampleSet
)