plot {tofsims} | R Documentation

## Generic method for plot

### Description

Method defining `plot()` for the `MassSpectra` class plot has no generic by default

### Usage

    plot(x, y, ...)

    ## S4 method for signature 'MassSpectra,missing'
    plot(x, y, ..., mzRange = c(0, 200), normalize = FALSE)

    ## S4 method for signature 'PCA,ANY'
    plot(
      x,
      ...,
      comps = c(1, 2),
      pcType = "pcaLoadings",
      label = FALSE,
      labelThreshold = 1
    )

### Arguments

`x` | object of type MassSpectra
`y` | missing
`...` | further args
`mzRange` | vector or lenght two, indicating the mz range to be plotted
`normalize` | boolean should the mass spectra be normalized
`comps` | numeric vector of length two denominating the components to be plotted
`pcType` | character 'pcaLoadings' or pcaScores'
`label` | boolean plot label
`labelThreshold` | numeric threshhold on which values to plot a label

### Details

The output of this method is adapted for plotting mass spectra. Uncalibrated data is plotted as xy plot while uncalibrated data is plotted as barplot. The parameter `mzRange` allows choosing the plot range directly according to the mz number (when calibrated). The argument `lineplot`, TRUE by default, allows to switch between line and barplot.

### Value

graphical output

plot of mass spectra

scatter loading/score plot

### Examples

    ## plot method for MassSpectra objects
    library(tofsimsData)
    data(tofsimsData)
    plot(testSpectra, mzRange=c(1,300),type='l')

[Package tofsims version 1.18.0 Index]