mavg {rchemo} | R Documentation |
Smoothing by moving average
Description
Smoothing, by moving average, of the row observations (e.g. spectra) of a dataset.
Usage
mavg(X, n = 5)
Arguments
X |
X-data ( |
n |
The number of points (i.e. columns of |
Value
A matrix of the transformed data.
Examples
data(cassav)
X <- cassav$Xtest
headm(X)
Xp <- mavg(X, n = 11)
headm(Xp)
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)
[Package rchemo version 0.1-2 Index]