## load library
library("MALDIquant")
## 5 point savitzky-golay filter
savitzkyGolay(rep(1:5, times=2), halfWindowSize=2)
# 1 2 3 4.43 3.71 2.29 1.57 3 4 5
## load example data
data("fiedler2009subset", package="MALDIquant")
## smooth spectra
s <- transformIntensity(fiedler2009subset, savitzkyGolay, halfWindowSize=12)Run the code above in your browser using DataLab