ir_bc_sg: Performs baseline correction on infrared spectra using a...

View source: R/ir_bc.R

ir_bc_sgR Documentation

Performs baseline correction on infrared spectra using a Savitzky-Golay baseline

Description

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 \insertCiteLasch.2012ir.

Usage

ir_bc_sg(x, ..., return_bl = FALSE)

Arguments

x

An object of class ir.

...

Arguments passed to ir_smooth() (except for method 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.

References

\insertAllCited

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)
}


henningte/ir documentation built on July 4, 2025, 5:12 p.m.