data("NIRcannabis")
X <- NIRcannabis$spc
# Savitzky-Golay smoothing, window 11, polynomial order 3
sg <- prep_smooth(w = 11, p = 3, algorithm = "savitzky-golay")
# Moving average smoothing, window 7
ma <- prep_smooth(w = 7, algorithm = "moving-average")
# Apply via preprocess_recipe
recipe <- preprocess_recipe(sg, device = "proxiscout")
X_smooth <- process(X, recipe)
Run the code above in your browser using DataLab