data(milk)
spectrum1 <- milk$spectra[1,1:10000,drop=FALSE]
ordinary <- baseline(spectrum1, method="als", lambda=6, p=0.01)
customized <- custom.baseline(spectrum1, 2900, c(1,20), trans.win=100,
just.plot=FALSE, method="als", lambda=6, p=0.01)
if (FALSE) {
plot(1:10000,spectrum1, type='l')
lines(1:10000,getBaseline(ordinary), lty=2, col=2, lwd=2)
lines(1:10000,customized$baseline, lty=3, col=3, lwd=2)
}
Run the code above in your browser using DataLab