smoothSpectrum.Rd
Offers two different methods for smoothing noise in raw spectral data: a moving average filter and the Savitzky-Golay filter (1).
smoothSpectrum( dat, mass_dat, intensity_dat, method = NULL, p = NULL, n = NULL, m = 0, ts = 1 )
dat | The name of the spectral data frame, containing |
---|---|
mass_dat | A character string; the name of the column in |
intensity_dat | A character string; the name of the column in
|
method | A character string; the method to be used for smoothing.
Available methods include a Savitzky-Golay filter ( |
p | Single numeric value. If |
n | Single odd numeric value. If |
m | Single numeric value. If |
ts | Single numeric value. If |
Returns a new data frame containing the smoothed spectral data.
https://github.com/wesleyburr/subMaldi (1) A. Savitzky, M.J.E. Golay, Smoothing and differentiation of data by simplified least-squares procedures, Anal. Chem. 36 (8) (1964) 1627-1639.
Kristen Yeh <kristenyeh@trentu.ca> Wesley Burr <wesleyburr@trentu.ca>
## Load sample dataset "Before1.rda" data("Before1") ## Testing method "sgolay" # test <- smoothSpectrum(dat = Before1, mass_dat = "mass", # intensity_dat = "Intensity", # method = "sgolay", p = 4, # n = 25, m = 0) ## Testing method "mov_avg" # test <- smoothSpectrum(dat = Before1, mass_dat = Before1$mass, # intensity_dat = Before1$Intensity, # method = "mov_avg", n = 25) #