Learn R Programming

rtms (version 0.2.0)

getSample.rtmsSpectrum: Extract a sample from an RTMS spectrum object

Description

Extracts a sample object of class rtmsSample from a single spectrum object of class rtmsSample usin g a list of peaks

Usage

# S3 method for rtmsSpectrum
getSample(x, peaks, ...)

getSampleFromSpectrum(spectrum, peaks, freqSpacing = TRUE, threshold = NULL)

Value

An RTMS sample object of class rtmsSample

Arguments

x

The spectrum object

peaks

A list of peak objects of class rtmsPeak

...

Additional parameters

spectrum

A full spectrum of class rtmsSpectrum

freqSpacing

If TRUE (the default), local maxima (estimated via quadratic interpolation) are calculated in inverse m/z (or frequency) space, as in FTMS spectra. If FALSE, maxima are calculated directy in m/z space

threshold

If NULL, all local maxima will be returned for each subsample; if set to particular value, only those maxima above that threshold will be returned.

Functions

  • getSample(rtmsSpectrum): The S3 method getSample for objects of class rtmsSpectrum; calls getSampleFromSpectrum

Examples

Run this code
peaks <- rtmsPeakList(c(1516.83,1530.84),peakWidth=0.2,windowWidth = c(5,10))
names(peaks) <- c("Product","Substrate")
sample <- getSample(exampleSpectrum,peaks)

Run the code above in your browser using DataLab