Calculate absorption coefficients and/or absorbance data at given wavelengths, spectral slopes, and their ratios.
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
)
A data.frame
with one row per sample, containing
the following columns:
Names or numbers of the samples.
Absorbance values, for every wavelength in out.A
.
Absorption coefficients, for every wavelength in out.a
.
Ratios of absorption coefficients, for every wl in
out.a.ratio
.
Spectral slopes, for every wl in out.slope
.
If out.slope.nrmse
is TRUE
, root-mean-square errors
normalised by the range of the absorption coefficients for the
models providing spectral slopes.
Ratios of spectral slopes, for every wl in
out.slope.ratio
.
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.
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.
Specifies whether x
contains absorbance (log10
;
\(A = \log_{10}\frac{I_0}{I}\);
unitless) or absorption coefficients (m^-1
;
\(
\alpha = \frac{\ln \frac{I_0}{I}}{l}
\);
\([\mathrm{m}^{-1}]\)).
Return absorbance values at the wavelengths given as a numeric vector.
Return absorption coefficients at the wavelengths given as a numeric vector.
Return ratios of absorption coefficients at the wavelengths given as a list of two-element numeric vectors. For every pair of wavelengths, \(\frac{\alpha(\lambda_1)}{\alpha(\lambda_2)} \) is returned.
Return spectral slopes at wavelength ranges given as a list of
two-element numeric vectors. See the slope.method
for the
description of how spectral slopes are computed.
Return ratios of spectral slopes for pairs of wavelength ranges given as a list of four-element numeric vectors. For every list element, the value returned is \( \frac{S(\lambda_1, \lambda_2)}{S(\lambda_3, \lambda_4)} \).
When computing slopes, also return the root-mean-square error for the models providing them, divided by the range of the response: \( \frac{1}{y_\mathrm{max} - y_\mathrm{min}} \sqrt{\sum_{i=1}^n\frac{(\hat{y}_i - y_i)^2}{n}} \).
Currently, the spectral slopes are calculated by fitting a linear model \( \ln \alpha = b_0 - b_1 \lambda \) and returning \(b_1\) as the slope. See albatross:::.Rdcite('Twardowski2004') for a discussion of the calculation methods for spectral slopes.
Requested wavelengths missing from the original grid are interpolated
using spline
. NA
values are returned
outside the original wavelength range.
albatross:::.Rdbibliography()
feemife