plot.spectrum: Line Plot Of A Spectrum

Description Usage Arguments Details Author(s) See Also Examples

View source: R/plot.spectrum.R

Description

Plots a spectrum (i.e. a dataframe with entries lambda and value or contsub). This is a convenience wrapper for plot.default which selects the correct columns automatically and defaults to type='l'.

Usage

1
2
3
4
## S3 method for class 'spectrum'
plot(x, add = FALSE, offset = 0, scale = 1,
              norm = FALSE, noise = FALSE, contsub = FALSE,
              contdiv = FALSE, mask=FALSE, ...)

Arguments

x

a "spectrum" object containing the components lambda and value and possibly noise or contsub

add

add the spectrum to an existing plot

scale

multiply the spectrum values by this number

offset

add a constant offset to the (scaled) spectrum

norm

Normalize the spectrum to either a mean value of unity (default) or standard deviation of unity (if uning contsub

noise

if TRUE then plot the noise spectrum

contsub

if TRUE then plot the continuum subtracted spectrum

contdiv

if TRUE then plot the continuum divided spectrum

mask

if not FALSE, then mark all masked points in the spectrum in magenta. The mask is typically contained in the spectrum x. Otherwise, mask can be any format accepted by convert.mask

...

Further graphical parameters (see 'par') may also be supplied as arguments.

Details

The spectrum can be scaled, offset or normalized. The normalization is the mean of the spectrum value, except if the continuum subtracted spectrum, when the standard deviation of that is used.

Author(s)

Oliver Czoske

See Also

plot, lines, par

Examples

1
2
3
4
5
spectrum <- data.frame(lambda=seq(3800, 6500, length=500),
value=rnorm(500), name="A random noise spectrum")

plot.spectrum(spectrum, ylim=c(-3, 5))
plot.spectrum(spectrum, add=TRUE, offset=1)

oczoske/slacR documentation built on May 20, 2019, 8:23 p.m.