View source: R/preprocessing.R
dderiv | R Documentation |
Calculation of the first derivatives, by finite differences, of the row observations (e.g. spectra) of a dataset.
dderiv(X, n = 5, ts = 1)
X |
X-data ( |
n |
The number of points (i.e. columns of |
ts |
A scaling factor for the finite differences (by default, |
A matrix of the transformed data.
data(cassav)
X <- cassav$Xtest
n <- 15
Xp <- dderiv(X, n = n) # = 1st derivate
#Xp <- dderiv(dderiv(X, n), n) # = 2nd derivate
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.