Learn R Programming

MALDIquant (version 1.3)

plot-methods: Plots an AbstractMassObject object.

Description

This is an overloaded method to allow plotting of an AbstractMassObject object.

Usage

## S3 method for class 'AbstractMassObject,missing':
plot(x, col="black", 
     xlab="mass", ylab="intensity", 
     type=ifelse(isMassPeaks(x), "h", "l"),
     xlim=c(ifelse(length(x@mass)>0, min(x@mass, na.rm=TRUE), 0),
            ifelse(length(x@mass)>0, max(x@mass, na.rm=TRUE), 1)),
     ylim=c(0, ifelse(length(x@intensity>0), max(x@intensity, na.rm=TRUE), 1)),
     main=x@metaData$name, sub=x@metaData$file, 
     cex.sub=0.75, col.sub="#808080", 
     abline.col="#808080", ...)

Arguments

x
MassSpectrum object
col
line colour, see par
xlab
title for the x-axis, see title
ylab
title for the y-axis, see title
type
type of plot: see plot
xlim
the x limits (x1, x2) of the plot, see plot.default
ylim
the y limits (y1, y2) of the plot, see plot.default
main
title for the plot, see title
sub
sub title for the plot, see title
cex.sub
sub title font size, see par
col.sub
sub title color, see par
abline.col
colour for horizontal line at y=0
...
arguments to be passed to plot

References

See website: http://strimmerlab.org/software/maldiquant/

See Also

AbstractMassObject,

Examples

Run this code
## load library
library("MALDIquant");

## create a MassSpectrum object by default constructor
s <- createMassSpectrum(mass=1:100, intensity=rnorm(100)^2,
                        metaData=list(name="example"));

## show some details
s;

## plot spectrum
plot(s);

Run the code above in your browser using DataLab