View source: R/preprocessing.R
| savgol | R Documentation | 
Smoothing by derivation, with a Savitzky-Golay filter, of the row observations (e.g. spectra) of a data set.
The function uses function sgolayfilt of package signal available on the CRAN.
savgol(X, m, n, p, ts = 1)| X | X-data). | 
| m | Derivation order. | 
| n | Filter length (must be odd), i.e. the number of colums in  | 
| p | Polynomial order. | 
| ts | Scaling factor (e.g. the absolute step between two columns in matrix  | 
A matrix of the transformed data.
X <- cassav$Xtest
m <- 1 ; n <- 11 ; p <- 2
Xp <- savgol(X, m, n, p)
oldpar <- par(mfrow = c(1, 1))
par(mfrow = c(1, 2))
plotsp(X, main = "Signal")
plotsp(Xp, main = "Corrected signal")
abline(h = 0, lty = 2, col = "grey")
par(oldpar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.