Learn R Programming

ir (version 0.4.1)

ir_bc_sg: 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 Lasch.2012ir.

Usage

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

Value

An object of class ir with the baseline corrected spectra and, if returnbl = TRUE, the baselines.

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

References

Examples

Run this code
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)
}

Run the code above in your browser using DataLab