Skip to contents

irp_eac_1 predicts the electron accepting capacity (EAC) from mid infrared spectra of the peat samples. This function may also work for organic matter in general (Teickner et al. 2022) .

Usage

irp_eac_1(x, ..., do_summary = FALSE)

Source

Teickner et al. (2022) .

Arguments

x

An object of class ir. Some tests are applied to check if the supplied spectra match the spectra used to fit the models (the spectral range is checked). The spectral resolution of the original spectral data should not be smaller than 4 cm\(^{-1}\) and it is not checked if this assumption is met.

...

Additional arguments passed to rstanarm::posterior_predict.stanreg().

do_summary

A logical value indicating if the predicted values should be returned in a summarized version (TRUE) or not (FALSE).

  • If do_summary = FALSE, a list column is returned and each element of the list column is a numeric vector with draws from the posterior distribution, including the residual variance of the model.

  • If do_summary = TRUE, each element is a quantities::quantities() object with the error attribute being the standard deviation of the unsummarized values.

Value

x with a new column "eac" with the predicted EAC values [\(\mu\)mol g\(_\text{C}^{-1}\)].

Note

The model still has a relatively large uncertainty because it is fitted with few samples (Teickner et al. 2022) . For further limitations, see Teickner et al. (2022) .

References

Teickner H, Gao C, Knorr K (2022). “Electrochemical Properties of Peat Particulate Organic Matter on a Global Scale: Relation to Peat Chemistry and Degree of Decomposition.” Global Biogeochemical Cycles. ISSN 0886-6236, 1944-9224, doi:10.1029/2021GB007160 .

See also

Examples

library(ir)

# make predictions
irpeat::irp_eac_1(ir::ir_sample_data[1, ], do_summary = TRUE)
#> # 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>,
#> #   eac (err) [umol/g]