Learn R Programming

tofsims (version 1.0.2)

addPeaks: generic method to add peaks

Description

This method will allow user to plot and add peaks manually. This method will take all parameters of PeakList plot method.

Usage

addPeaks(object, mzs, width, ...)

## S3 method for class 'PeakList,missing,numeric': addPeaks(object, mzs, width, ...)

## S3 method for class 'PeakList,numeric,numeric': addPeaks(object, mzs, width, ...)

Arguments

object
PeakList object
mzs
numeric vector M/z's where peaks shall be added
width
fixed value to add (m/z)
...
further args

Value

  • object updated PeakList object

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)
par(mfcol=c(1,2))
plot(testPeakList, mzRange=c(25,32), type = 'l')
testPeakList<-addPeaks(testPeakList, mzs=26:31, width=0.4)
plot(testPeakList, mzRange=c(25,32), type = 'l')

Run the code above in your browser using DataLab