Learn R Programming

tofsims (version 1.0.2)

peakWidths: Generic method peakWidths

Description

Generic method peakWidths

peakWidths

Usage

peakWidths(object, plot = FALSE)

## S3 method for class 'PeakList': peakWidths(object, plot = FALSE)

Arguments

object
PeakList object
plot
boolean should there be graphical output

Value

  • vector of peak widths

Details

This method will calculate peak widths (m/z) based on lower and upper widths.

Method to return the peakWidth values of all peaks. On plot=TRUE the width values are ploted against the M/z of the corresponding peak.

Examples

Run this code
library(tofsimsData)
data(tofsimsData)
testPeakList<-PeakList(analysisName = analysisName(testSpectra),
instrument = instrument(testSpectra),
nz = nz(testSpectra),
calibration = calibration(testSpectra),
calibPoints = calibPoints(testSpectra),
mz = mz(testSpectra),
peakIDs = NULL,
peakMzs = NULL)
testPeakList<-addPeaks(testPeakList, mzs=26:31, width=0.4)
testPeakList<-findPeakWidth(testPeakList, p = 3, n = 199, 
span = 100, widthExtLower = 2, widthExtUpper = 2)
testPeakList<-peakWidths(testPeakList, plot = FALSE)

Run the code above in your browser using DataLab