fit_carbon_regression: fit_carbon_regression

View source: R/reference_data_regression.R

fit_carbon_regressionR Documentation

fit_carbon_regression

Description

fit_carbon_regression

Usage

fit_carbon_regression(
  ref_data,
  method,
  calibration_half_width,
  plot_regression_data = FALSE,
  plot_dir = "/dev/null",
  site
)

Arguments

ref_data

Reference data.frame from which to estimate calibration parameters.

method

Are we using the Bowling et al. 2003 method ("Bowling_2003") or direct linear regression of d13C and CO2 mole fractions ("linreg")?

calibration_half_width

Determines the period (in days) from which reference data are selected (period is 2*calibration_half_width).

plot_regression_data

True or false - should we plot the data used in the regression? Useful for debugging.

plot_dir

If plot_regression_data is true, where should the plots be saved?

site

Needed for regression plots.

Value

Returns a data.frame of calibration parameters. If method == "Bowling_2003", then data.frame includes gain and offset parameters for 12CO2 and 13CO2, and r^2 values for each regression. If method == "linreg", then data.frame includes slope, intercept, and r^2 values for d13C and CO2 values.

Author(s)

Rich Fiorella rfiorella@lanl.gov


NEONiso documentation built on Sept. 23, 2022, 1:06 a.m.