prep.savgol: Savitzky-Golay filter

View source: R/prep.R

prep.savgolR Documentation

Savitzky-Golay filter

Description

Applies Savitzky-Golay filter to the rows of data matrix

Usage

prep.savgol(data, width = 3, porder = 1, dorder = 0, w = NULL)

Arguments

data

a matrix with data values

width

width of the filter window

porder

order of polynomial used for smoothing

dorder

order of derivative to take (0 - no derivative)

w

do not use, required for training of preprocessing model.

Details

The function implements algorithm described in [1] which handles the edge points correctly and does not require to cut the spectra.

References

1. Peter A. Gorry. General least-squares smoothing and differentiation by the convolution (Savitzky-Golay) method. Anal. Chem. 1990, 62, 6, 570–573, https://doi.org/10.1021/ac00205a007.


mdatools documentation built on March 6, 2026, 5:08 p.m.