absindex: Functions of absorbance data

View source: R/absindex.R

absindexR Documentation

Functions of absorbance data

Description

Calculate absorption coefficients and/or absorbance data at given wavelengths, spectral slopes, and their ratios.

Usage

  absindex(
    x, abs.path, unit = c("log10", "m^-1"), out.A = 254,
    out.a = c(350, 355, 374, 443),
    out.a.ratio = list(c(250, 365), c(465, 665)),
    out.slope = list(c(275, 295), c(350, 400)),
    out.slope.ratio = list(c(275, 295, 350, 400)),
    out.slope.nrmse = FALSE
  )

Arguments

x

Absorption data, either a list of two-column matrix-like objects with wavelengths in first column and values in second column, or a multi-column matrix-like object with wavelengths in first column and values in all other columns. Can be named in order to match with the abs.path values, see feemife for details.

abs.path

A numeric vector of optical path lengths for every spectrum, in centimetres. Defaults to 1 for all samples. If specified, should be either named, with names matching x, or unnamed and containing exactly the same number of path lengths.

unit

Specifies whether x contains absorbance (⁠log10⁠; 3{A = \log_{10}\frac{I_0}{I}

A = log10(I0 / I) A = log<sub>10</sub>(<sup>I<sub>0</sub></sup>/<sub>I</sub>); unitless) or absorption coefficients (⁠m^-1⁠; 3{ \alpha = \frac{\ln \frac{I_0}{I}}{l}

Details

Currently, the spectral slopes are calculated by fitting a linear model 3{ \ln \alpha = b_0 - b_1 \lambda

Value

A data.frame with one row per sample, containing the following columns:

sample

Names or numbers of the samples.

A.<wavelength>

Absorbance values, for every \vwavelength in out.A.

a.<wavelength>

Absorption coefficients, for every \vwavelength in out.a.

aR.<wl[1]>.<wl[2]>

Ratios of absorption coefficients, for every \vwl in out.a.ratio.

S.<wl[1]>.<wl[2]>

Spectral slopes, for every \vwl in out.slope.

NRMSE.S.<wl[1]>.<wl[2]>

If out.slope.nrmse is TRUE, root-mean-square errors normalised by the range of the absorption coefficients for the models providing spectral slopes.

SR.<wl[1]>.<wl[2]>.<wl[3]>.<wl[4]>

Ratios of spectral slopes, for every \vwl in out.slope.ratio.

References

\bibliography

See Also

feemife

Examples

  data(feems)
  absindex(absorp)

albatross documentation built on May 29, 2024, 9:10 a.m.