I want to preprocess spectra using a Savitzky-Golay filter in R. Do to this I need the equivalent of this Python code (using scipy.signal):
savgol_filter(X, 11, 2, 1, mode = 'nearest')
Using the package 'signal' I can use this, but this does not replicate the above at all.
sgolayfilt(X, n = 11, p = 2, m = 1)
Thanks!