cdom_fit_exponential: Fit an exponential model to CDOM data.

Description Usage Arguments Details Value Examples

Description

Fit an exponential model to CDOM data.

Usage

1
cdom_fit_exponential(wl, absorbance, wl0 = 350, startwl, endwl)

Arguments

wl

The wavelength vector.

absorbance

The absorbance vector.

wl0

The reference wavelength (ex.: 350).

startwl

The starting wavelength (ex.: 240).

endwl

The ending wavelength (ex.: 600).

Details

y = a0 + e^{(-S(x - λ_0))} + K

Value

A list containing:

params

A data frame with values of fitted parameters.

r2

R2 of the nls model.

data

A data frame with fitted (predicted) values of the model.

The function will return NULL if the model did not converged.

Examples

1
2
3
4
5
6
7
8
9
# Fit an exponential model using the reference wavelength 350 between 190 and 900 nm.

data(spectra)

fit <- cdom_fit_exponential(spectra$wavelength, spectra$spc1, 350, 190, 900)
str(fit)

plot(spectra$wavelength, spectra$spc1)
lines(spectra$wavelength, fit$data$.fitted, col = "red")

Example output

Deprecated: please use `purrr::possibly()` insteadWarning in fit_exponential().
 NULL

cdom documentation built on May 1, 2019, 10:48 p.m.