# Loading example data
data(australia)
spectra(australia) <- sr_no ~ ... ~ 350:2500
# Second derivative
r <- apply_spectra(australia, diff, 2)
plot(r)
# Smoothing kernel
k <- kernel("daniell", 20) # define a kernel
r <- apply_spectra(australia, kernapply, k)
plot(r)
if (FALSE) {
# Savitzky-Golay filter (from the signal package)
library(signal)
r <- apply_spectra(australia, sgolayfilt, n = 33, p = 4)
plot(r)
}
Run the code above in your browser using DataLab