# Fit an A-Ci curve on a dataframe that contains Ci, Photo and optionally Tleaf and PPFD.
# Here, we use the built-in example dataset 'acidata1'.
f <- fitaci(acidata1)
# Note that the default behaviour is to correct Vcmax and Jmax for temperature,
# so the estimated values are at 25C. To turn this off:
f2 <- fitaci(acidata1, Tcorrect=FALSE)
# To use different T response parameters (see ?Photosyn),
f3 <- fitaci(acidata1, Tcorrect=TRUE, EaV=25000)
# Make a standard plot
plot(f)
# Look at a summary of the fit
summary(f)
# Extract coefficients only
coef(f)
# The object 'f' also contains the original data with predictions.
# Here, Amodel are the modelled (fitted) values, Ameas are the measured values.
with(f$df, plot(Amodel, Ameas))
abline(0,1)
# The fitted values can also be extracted with the fitted() function:
fitted(f)
# The non-linear regression (nls) fit is stored as well,
summary(f$nlsfit)
# The curve generator is stored as f$Photosyn:
# Calculate photosynthesis at some value for Ci, using estimated parameters and mean Tleaf,
# PPFD for the dataset.
f$Photosyn(Ci=820)
# Photosynthetic rate at the transition point:
f$Photosyn(Ci=f$Ci_transition)$ALEAF
# Set the transition point; this will fit Vcmax and Jmax separately. Note that the *actual*
# transition is quite different from that provided, this is perfectly fine :
# in this case Jmax is estimated from the latter 3 points only (Ci>800), but the actual
# transition point is at ca. 400ppm.
g <- fitaci(acidata1, citransition=800)
plot(g)
g$Ci_transition
# Use measured Rd instead of estimating it from the A-Ci curve.
# The Rd measurement must be added to the dataset used in fitting,
# and you must set useRd=TRUE.
acidata1$Rd <- 2
f2 <- fitaci(acidata1, useRd=TRUE)
f2
Run the code above in your browser using DataLab