addPeaks {tofsims} | R Documentation

## 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, ...)

    ## S4 method for signature 'PeakList,missing,numeric'
    addPeaks(object, mzs, width, ...)

    ## S4 method for signature '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

    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')

[Package tofsims version 1.18.0 Index]