Description Usage Arguments Value Author(s) References Examples
View source: R/smoothSpectrum.R
Offers two different methods for smoothing noise in raw spectral data: a moving average filter and the Savitzky-Golay filter (1).
1 2 3 4 5 6 7 8 9 10 | 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.
Kristen Yeh <kristenyeh@trentu.ca> Wesley Burr <wesleyburr@trentu.ca>
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## 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)
#
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.