View source: R/fit_aq_response.R
fit_aq_response2 | R Documentation |
We recommend using fit_photosynthesis()
with argument .photo_fun = "aq_response"
rather than calling this function directly.
fit_aq_response2(
.data,
.model = "default",
.method = "ls",
usealpha_Q = FALSE,
alpha_Q = 0.84,
quiet = FALSE,
brm_options = NULL
)
.data |
A data frame containing plant ecophysiological data. See |
.model |
A character string of model name to use. See |
.method |
A character string of the statistical method to use: 'ls' for least-squares and 'brms' for Bayesian model using |
usealpha_Q |
Flag. Should light intensity be multiplied by |
alpha_Q |
Number. Absorbance of incident light. Default value is 0.84. Ignored if |
quiet |
Flag. Should messages be suppressed? Default is FALSE. |
brm_options |
A list of options passed to |
If .method = 'ls'
: an stats::nls()
object.
If .method = 'brms'
: a brms::brmsfit()
object.
Rd fitted in this way is essentially the same as the Kok (1956) method, and represents a respiration value in the light that may not be accurate. Rd output should thus be interpreted more as a residual parameter to ensure an accurate fit of the light response parameters. Model originally from Marshall & Biscoe (1980).
Marshall B, Biscoe P. 1980. A model for C3 leaves describing the dependence of net photosynthesis on irradiance. J Ex Bot 31:29-39
library(broom)
library(dplyr)
library(photosynthesis)
# Read in your data
dat = system.file("extdata", "A_Ci_Q_data_1.csv", package = "photosynthesis") |>
read.csv() |>
# Set grouping variable
mutate(group = round(CO2_s, digits = 0)) |>
# For this example, round sequentially due to CO2_s set points
mutate(group = as.factor(round(group, digits = -1)))
# Fit one light-response curve
fit = fit_photosynthesis(
.data = filter(dat, group == 600),
.photo_fun = "aq_response",
.vars = list(.A = A, .Q = Qabs),
)
# The 'fit' object inherits class 'nls' and many methods can be used
## Model summary:
summary(fit)
## Estimated parameters:
coef(fit)
## 95% confidence intervals:
confint(fit)
## Tidy summary table using 'broom::tidy()'
tidy(fit, conf.int = TRUE, conf.level = 0.95)
# Fit multiple curves with **photosynthesis** and **purrr**
library(purrr)
fits = dat |>
split(~ group) |>
map(fit_photosynthesis, .photo_fun = "aq_response", .vars = list(.A = A, .Q = Qabs))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.