Skip to contents

irp_content computes the contents of various components of peat from mid infrared spectra of peat samples. Some functions may also work for organic matter in general. Note that this function is a wrapper function to several individual functions in irpeat. In irp_content any warnings and messages regarding issues with the data are suppressed and nothing will be exported to disk. In case of doubt, use the corresponding functions with warnings activated.

Usage

irp_content(x, variable, ...)

Arguments

x

An object of class ir.

variable

A character vector with one or more values that define for which components contents are computed for the spectra in x. Currently allowed values are:

"all"

irp_content computes all of the values below.

"klason_lignin_hodgkins"

Klason lignin mass fraction [g/g] as computed by irp_content_klh_hodgkins().

"holocellulose_hodgkins"

Holocellulose mass fraction [g/g] as computed by irp_content_klh_hodgkins().

"klason_lignin_2"

Klason lignin mass fraction [g/g] as computed by irp_klason_lignin_2().

"holocellulose_2"

Holocellulose mass fraction [g/g] as computed by irp_holocellulose_2().

"eac_1"

Electron accepting capacity as computed by irp_eac_1().

"edc_1"

Electron donating capacity as computed by irp_edc_1().

...

Further arguments passed to individual prediction functions.

Value

An object of class ir with additional columns containing the predictions for the spectra in x.

Examples

library(ir)

irp_content(ir::ir_sample_data[1, ], variable = "klason_lignin_hodgkins")
#> # A tibble: 1 × 8
#>   id_measurement id_sample sample_type sample_comment       klason_lignin
#> *          <int> <chr>     <chr>       <chr>                          [1]
#> 1              1 GN 11-389 needles     Abies Firma Momi fir         0.360
#> # … with 3 more variables: holocellulose [1], spectra <named list>,
#> #   klason_lignin_hodgkins (err) [g/g]

if (FALSE) {
irp_content(ir::ir_sample_data[1, ], variable = "klason_lignin_2")
irp_content(ir::ir_sample_data[1, ], variable = "holocellulose_2")
irp_content(ir::ir_sample_data[1, ], variable = "eac_1")
irp_content(ir::ir_sample_data[1, ], variable = "edc_1")
}