fit_light_response_curve: A function that fits a light response curve.

View source: R/fit_light_response_curve.R

fit_light_response_curveR Documentation

A function that fits a light response curve.

Description

A function that fits a light response curve. The input is a dataframe. It extracts the columns A, elapsed and Qin. (These have to be columns in the dataframe or it will result in an error) It sets the initial parameters Rd, alpha, Pmax, curvature and the light_compensation_point. If manual check is on it will plot the data. It will try to run the model. The formula is: -Rd + (alpha * PPF + Pmax - sqrt((alpha * PPF + Pmax)^2 - 4 * curvature * PPF * Pmax * alpha))/(2 * curvature). If manual check is on it will ask the user if the fit is acceptable. If there is an error or warning it will return a list of NA values. If the fit is accepted it will return a list with the fitted parameters.

Usage

fit_light_response_curve(
  dataframe,
  title = "Light response curve",
  subtitle = "",
  manual_check = TRUE,
  save_plot = FALSE,
  save_path = "output_directory_licorfiles/light_response_plots/"
)

Arguments

dataframe

The dataframe that will be analysed.

title

A string for the title of the plot.

subtitle

A string of the subtitle to use. Filename recommended.

manual_check

A boolean that regulates if the fits are checked.

save_plot

A boolean that regulates if the plots get saved.

save_path

A string of the pathname where the plots get saved.

Value

Returns a list of the fitted light response parameters

Author(s)

Sam Loontjens

Examples

fitted_parameters <- fit_light_response_curve(mydata)


SamLoontjens/HandlingLicorFiles documentation built on Nov. 14, 2023, 6:32 a.m.