Learn R Programming

tofsims (version 1.0.2)

plot: Generic method for plot

Description

Generic method for plot

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

Usage

plot(x, y, ...)

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

## S3 method for class '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

Value

  • graphical output

    plot of mass spectra

    scatter loading/score plot

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.

Examples

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

Run the code above in your browser using DataLab