Learn R Programming

MALDIquant (version 1.9)

smoothIntensity-methods: Smoothes intensities of a MassSpectrum object.

Description

This method smoothes the intensity values of a MassSpectrum object.

Usage

## S3 method for class 'MassSpectrum':
smoothIntensity(object,
  method=c("SavitzkyGolay", "MovingAverage"), halfWindowSize,
  ...)

Arguments

object
AbstractMassObject object or a list of AbstractMassObject objects.
method
used smoothing method; for method="SavitzkyGolay" see .savitzkyGolay, for method="MovingAverage" see
halfWindowSize
half window size. The best size differs depending on the selected method; see .savitzkyGolay and .movingAverage

References

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

See Also

.savitzkyGolay, .movingAverage, MassSpectrum

Examples

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

## load example data
data("fiedler2009subset", package="MALDIquant")

## smooth spectra
s <- smoothIntensity(fiedler2009subset, method="MovingAverage",
                     halfWindowSize=2)
## or
s <- smoothIntensity(fiedler2009subset, method="SavitzkyGolay",
                     halfWindowSize=10)

Run the code above in your browser using DataLab