data(fishoil)
Raman <- fishoil$Raman[, 850:3300]
SavGol <- SavitzkyGolay(Raman)
old.par <- par(mfrow = c(2,1), mar = c(4,4,1,1))
matplot(colnames(Raman), t(Raman), type = 'l',
ylab = 'Relative intensity', xlab = 'Raw spectra')
matplot(colnames(SavGol), t(SavGol), type = 'l',
ylab = 'Relative intensity', xlab = 'Smoothed 2nd derivative')
par(old.par)
Run the code above in your browser using DataLab