# NOT RUN {
# 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)
# }
# NOT RUN {
# Savitzky-Golay filter (from the signal package)
library(signal)
r <- apply_spectra(australia, sgolayfilt, n = 33, p = 4)
plot(r)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab