# NOT RUN {
# Loading example data
data(australia)
spectra(australia) <- sr_no ~ ... ~ 350:2500
# Subsample for demo purposes
australia <- australia[1:10,]
# Correction using the default method (irls)
bl <- base_line(australia)
plot(bl)
# Specifying another method for baseline calculation
bl2 <- base_line(australia, method = "modpolyfit")
plot(bl2)
# Using the baseline package independently
# (useful to plot the corrections)
# }
# NOT RUN {
library(baseline)
bl3 <- baseline(spectra(australia), method = 'irls')
class(bl3) # this is a baseline object
plot(bl3)
# Affecting the baseline-corrected spectra back
# to the SpectraDataFrame object
spectra(australia) <- getCorrected(bl3)
plot(australia)
# Using the baselineGUI with inspectr
baselineGUI(spectra(australia))
## When happy with a configuration, clik "Apply to all" and
## save the results under a name, e.g. "corrected.spectra"
spectra(australia) <- getCorrected(corrected.spectra)
plot(australia)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab