Performs baseline correction on infrared spectra using a Savitzky-Golay baseline
Source:R/ir_bc.R
ir_bc_sg.Rd
ir_bc_sg
computes a smoothed version of spectra using
ir_smooth()
with method = "sg"
and uses this as baseline
which is subtracted from the spectra to perform a baseline correction
Lasch.2012ir.
Arguments
- x
An object of class
ir
.- ...
Arguments passed to
ir_smooth()
(except formethod
which is always set to"sg"
).- return_bl
A logical value indicating if for each spectrum the baseline should be returned instead of the corrected intensity values (
return_bl = TRUE
) or not (return_bl = FALSE
).
Value
An object of class ir
with the baseline corrected spectra and,
if returnbl = TRUE
, the baselines.
Examples
if(! requireNamespace("signal", quietly = TRUE)) {
x <-
ir::ir_sample_data |>
ir::ir_bc_sg(p = 3, n = 199, ts = 1, m = 0, return_bl = FALSE)
}