Description Usage Arguments Details Value References Examples

Fits the Farquhar-Berry-von Caemmerer model of photosynthesis to measurements of
photosynthesis and intercellular *CO2* concentration (Ci). Estimates Jmax, Vcmax, Rd
and their standard errors. A simple plotting method is also included, as well as the function
`fitacis`

which quickly fits multiple A-Ci curves (see its help page). Temperature
dependencies of the parameters are taken into account following Medlyn et al. (2002), see
`Photosyn`

for more details.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
fitaci(data, varnames = list(ALEAF = "Photo", Tleaf = "Tleaf", Ci = "Ci", PPFD
= "PARi", Rd = "Rd"), Tcorrect = TRUE, Patm = 100, citransition = NULL,
quiet = FALSE, startValgrid = TRUE, fitmethod = c("default", "bilinear",
"onepoint"), algorithm = "default", fitTPU = FALSE, alphag = 0,
useRd = FALSE, PPFD = NULL, Tleaf = NULL, alpha = 0.24,
theta = 0.85, gmeso = NULL, EaV = 82620.87, EdVC = 0,
delsC = 645.1013, EaJ = 39676.89, EdVJ = 2e+05, delsJ = 641.3615,
GammaStar = NULL, Km = NULL, id = NULL, ...)
## S3 method for class 'acifit'
plot(x, what = c("data", "model", "none"), xlim = NULL,
ylim = NULL, whichA = c("Ac", "Aj", "Amin", "Ap"), add = FALSE,
pch = 19, addzeroline = TRUE, addlegend = !add, legendbty = "o",
transitionpoint = TRUE, linecols = c("black", "blue", "red"), lwd = c(1,
2), ...)
``` |

`data` |
Dataframe with Ci, Photo, Tleaf, PPFD (the last two are optional). For |

`varnames` |
List of names of variables in the dataset (see Details). |

`Tcorrect` |
If TRUE, Vcmax and Jmax are corrected to 25C. Otherwise, Vcmax and Jmax are estimated at measurement temperature. |

`Patm` |
Atmospheric pressure (kPa) |

`citransition` |
If provided, fits the Vcmax and Jmax limited regions separately (see Details). |

`quiet` |
If TRUE, no messages are written to the screen. |

`startValgrid` |
If TRUE (the default), uses a fine grid of starting values to increase the chance of finding a solution. |

`fitmethod` |
Method to fit the A-Ci curve. Either 'default' (Duursma 2015), 'bilinear' (See Details), or 'onepoint' (De Kauwe et al. 2016). |

`algorithm` |
Passed to |

`fitTPU` |
Logical (default FALSE). Attempt to fit TPU limitation (fitmethod set to 'bilinear' automatically if used). See Details. |

`alphag` |
When estimating TPU limitation (with |

`useRd` |
If Rd provided in data, and useRd=TRUE (default is FALSE), uses measured Rd in fit. Otherwise it is estimated from the fit to the A-Ci curve. |

`PPFD` |
Photosynthetic photon flux density ('PAR') (mu mol m-2 s-1) |

`Tleaf` |
Leaf temperature (degrees C) |

`alpha` |
Quantum yield of electron transport (mol mol-1) |

`theta` |
Shape of light response curve. |

`gmeso` |
Mesophyll conductance (mol m-2 s-1 bar-1). If not NULL (the default), Vcmax and Jmax are chloroplastic rates. |

`EaV, EdVC, delsC` |
Vcmax temperature response parameters |

`EaJ, EdVJ, delsJ` |
Jmax temperature response parameters |

`Km, GammaStar` |
Optionally, provide Michaelis-Menten coefficient for Farquhar model, and Gammastar. If not provided, they are calculated with a built-in function of leaf temperature. |

`id` |
Names of variables (quoted, can be a vector) in the original dataset to be stored
in the result. Most useful when using |

`...` |
Further arguments (ignored at the moment). |

`x` |
For plot.acifit, an object returned by |

`what` |
The default is to plot both the data and the model fit, or specify 'data' or 'model' to plot one of them, or 'none' for neither (only the plot region is set up) |

`xlim` |
Limits for the X axis, if left blank estimated from data |

`ylim` |
Limits for the Y axis, if left blank estimated from data |

`whichA` |
By default all photosynthetic rates are plotted (Aj=Jmax-limited (blue), Ac=Vcmax-limited (red), Hyperbolic minimum (black)), TPU-limited rate (Ap, if estimated in the fit). Or, specify one or two of them. |

`add` |
If TRUE, adds to the current plot |

`pch` |
The plotting symbol for the data |

`addzeroline` |
If TRUE, the default, adds a dashed line at y=0 |

`addlegend` |
If TRUE, adds a legend (by default does not add a legend if add=TRUE) |

`legendbty` |
Box type for the legend, passed to argument bty in |

`transitionpoint` |
For plot.acifit, whether to plot a symbol at the transition point. |

`linecols` |
Vector of three colours for the lines (limiting rate, Ac, Aj), if one value provided it is used for all three. |

`lwd` |
Line widths, can be a vector of length 2 (first element for Ac and Aj, second one for the limiting rate). |

The default method to fit A-Ci curves (set by
`fitmethod="default"`

) uses non-linear regression to fit the A-Ci curve. No assumptions
are made on which part of the curve is Vcmax or Jmax limited. Normally, all three parameters
are estimated: Jmax, Vcmax and Rd, unless Rd is provided as measured (when `useRd=TRUE`

,
and Rd is contained in the data). This is the method as described by Duursma (2015, Plos One).

The 'bilinear' method to fit A-Ci curves (set by `fitmethod="bilinear"`

) linearizes
the Vcmax and Jmax-limited regions, and applies linear regression twice to estimate first
Vcmax and Rd, and then Jmax (using Rd estimated from the Vcmax-limited region). The transition
point is found as the one which gives the best overall fit to the data (i.e. all possible
transitions are tried out, similar to Gu et al. 2010, PCE). The advantage of this method is that
it *always* returns parameter estimates, so it should be used in cases where the default
method fails. Be aware, though, that the default method fails mostly when the curve contains
bad data (so check your data before believing the fitted parameters).

When `citransition`

is set, it splits the data into a Vcmax-limited (where Ci < citransition),
and Jmax-limited region (Ci > citransition). Both parameters are then estimated separately for
each region (Rd is estimated only for the Vcmax-limited region). **Note** that the actual
transition point as shown in the standard plot of the fitted A-Ci curve may be quite different
from that provided, since the fitting method simply decides which part of the dataset to use
for which limitation, it does not constrain the actual estimated transition point directly.
See the example below. If `fitmethod="default"`

, it applies non-linear regression to
both parts of the data, and when fitmethod="bilinear", it uses linear regression on the
linearized photosynthesis rate. Results will differ between the two methods (slightly).

The 'onepoint' fitting method is a very simple estimation of Vcmax and Jmax for every point
in the dataset, simply by inverting the photosynthesis equation. See De Kauwe et al. (2016)
for details. The output will give the original data with Vcmax and Jmax added (note you can
set `Tcorrect`

as usual!). For increased reliability, this method only works if
dark respiration (Rd) is included in the data (`useRd`

is set automatically when
setting `fitmethod='one-point'`

). This method is not recommended for full A-Ci curves,
but rather for spot gas exchange measurements, when a simple estimate of Vcmax or Jmax
is needed, for example when separating stomatal and non-stomatal drought effects on
photosynthesis (Zhou et al. 2013, AgForMet). The user will have to decide whether the Vcmax
or Jmax rates are used in further analyses. This fitting method can not be used in `fitacis`

, because Vcmax and Jmax are already estimated for each point in the dataset.

Optionally, the `fitaci`

function estimates the triose-phosphate
utilization (TPU) rate. The TPU can act as another limitation on photosynthesis, and can be
recognized by a 'flattening out' of the A-Ci curve at high Ci. When `fitTPU=TRUE`

, the
fitting method used will always be 'bilinear'. The TPU is estimated by trying out whether the
fit improves when the last n points of the curve are TPU-limited (where n=1,2,...). When TPU is
estimated, it is possible (though rare) that no points are Jmax-limited (in which case estimated
Jmax will be NA). A minimum of two points is always reserved for the estimate of Vcmax and Rd.
An additional parameter (`alphag`

) can be set that affects the behaviour at high Ci (see
Ellsworth et al. 2015 for details, and also `Photosyn`

). See examples.

When `Tcorrect=TRUE`

(the default), Jmax and Vcmax
are re-scaled to 25C, using the temperature response parameters provided (but Rd is always
at measurement temperature). When `Tcorrect=FALSE`

, estimates of all parameters are at
measurement temperature. If TPU is fit, it is never corrected for temperature. Important
parameters to the fit are GammaStar and Km, both of which are calculated from leaf temperature
using standard formulations. Alternatively, they can be provided as known inputs.

It is possible to provide an estimate of the mesophyll
conductance as input (`gmeso`

), in which case the fitted Vcmax and Jmax are to be interpreted
as chloroplastic rates. When using gmeso, it is recommended to use the 'default' fitting
method (which will use the Ethier&Livingston equations inside `Photosyn`

). It is also
implemented with the 'bilinear' method but it requires more testing (and seems to give
some strange results). When gmeso is set to a relatively low value, the resulting fit
may be quite strange.

The A-Ci curve parameters depend on the values of a number
of other parameters. For Jmax, PPFD is needed in order to express it as the asymptote. If
PPFD is not provided in the dataset, it is assumed to equal 1800 mu mol m-2 s-1 (in which
case a warning is printed). It is possible to either provide PPFD as a variable in the
dataset (with the default name 'PARi', which can be changed), or as an argument to
the `fitaci`

directly.

The default **plot** of the fit is constructed
with `plot.acifit`

, see Examples below. When plotting the fit, the A-Ci curve
is simulated using the `Aci`

function, with leaf temperature (Tleaf) and PPFD
set to the mean value for the dataset. The **coefficients** estimated in the fit
(Vcmax, Jmax, and usually Rd) are extracted with `coef`

. The summary of the fit is
the same as the 'print' method, that is `myfit`

will give the same output as
`summary(myfit)`

(where `myfit`

is an object returned by `fitaci`

).

Because fitaci returns the fitted `nls`

object, more details on statistics of
the fit can be extracted with standard tools. The Examples below shows the use of the
nlstools to extract many details of the fit at once. The fit also includes the
**root mean squared error** (RMSE), which can be extracted as `myfit$RMSE`

. This
is a useful metric to compare the different fitting methods.

Note that atmospheric pressure (Patm) is taken into account, assuming the original data are in molar units (Ci in mu mol mol-1, or ppm). During the fit, Ci is converted to mu bar, and Km and Gammastar are recalculated accounting for the effects of Patm on the partial pressure of oxygen. When plotting the fit, though, molar units are shown on the X-axis. Thus, you should get (nearly) the same fitted curve when Patm was set to a value lower than 100kPa, but the fitted Vcmax and Jmax will be higher. This is because at low Patm, photosynthetic capacity has to be higher to achieve the same measured photosynthesis rate.

A list of class 'acifit', with the following components:

- df
A dataframe with the original data, including the measured photosynthetic rate (Ameas), the fitted photosynthetic rate (Amodel), Jmax and Vcmax-limited gross rates (Aj, Ac), TPU-limited rate (Ap), dark respiration (Rd), leaf temperature (Tleaf), chloroplastic CO2 (Cc), PPFD, atmospheric pressure (Patm), and 'original Ci, i.e. the Ci used as input (which is different from the Ci used in fitting if Patm was not set to 100kPa)

- pars
Contains the parameter estimates and their approximate standard errors

- nlsfit
The object returned by

`nls`

, and contains more detail on the quality of the fit- Tcorrect
whether the temperature correction was applied (logical)

- Photosyn
A copy of the

`Photosyn`

function with the arguments adjusted for the current fit. That is, Vcmax, Jmax and Rd are set to those estimated in the fit, and Tleaf and PPFD are set to the mean value in the dataset. All other parameters that were set in fitaci are also used (e.g. temperature dependency parameters, TPU, etc.).- Ci_transition
The Ci at which photosynthesis transitions from Vcmax to Jmax limited photosynthesis.

- Rd_measured
Logical - was Rd provided as measured input?

- GammaStar
The value for GammaStar, either calculated or provided to the fit.

- Km
he value for Km, either calculated or provided to the fit.

- kminput
Was Km provided as input? (If FALSE, it was calculated from Tleaf)

- gstarinput
Was GammaStar provided as input? (If FALSE, it was calculated from Tleaf)

- fitmethod
The fitmethod uses, either default or bilinear

- citransition
The input citransition (NA if it was not provided as input)

- gmeso
The mesophyll conductance used in the fit (NA if it was not set)

- fitTPU
Was TPU fit?

- alphag
The value of alphag used in estimating TPU.

- RMSE
The Root-mean squared error, calculated as

`sqrt(sum((Ameas-Amodel)^2))`

.- runorder
The data returned in the 'df' slot are ordered by Ci, but in rare cases the original order of the data contains information; 'runorder' is the order in which the data were provided.

Duursma, R.A., 2015. Plantecophys - An R Package for Analysing and Modelling Leaf Gas Exchange Data. PLoS ONE 10, e0143346. doi:10.1371/journal.pone.0143346

De Kauwe, M. G. et al. 2016. A test of the 'one-point method' for estimating maximum carboxylation capacity from field-measured, light-saturated photosynthesis. New Phytol 210, 1130-1144.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | ```
## Not run:
# 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)
# Many more details can be extracted with the nlstools package
library(nlstools)
overview(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
# Fit TPU limitation
ftpu <- fitaci(acidata1, fitTPU=TRUE, PPFD=1800, Tcorrect=TRUE)
plot(ftpu)
## End(Not run)
``` |

```
Result of fitaci.
Data and predictions:
Ci Ameas Amodel Ac Aj Ap Rd VPD
1 72.81690 -0.6656991 -0.7314466 0.6051439 1.233113 1000 1.336532 1.5
2 89.33801 0.6089389 0.5060336 1.8427690 3.513935 1000 1.336532 1.5
3 119.73218 2.4030110 2.7087379 4.0458397 6.918011 1000 1.336532 1.5
4 163.84422 5.5908708 5.7507507 7.0887147 10.595421 1000 1.336532 1.5
5 219.61709 9.2532753 9.3634028 10.7035076 13.904585 1000 1.336532 1.5
6 259.24215 12.0213403 11.7820610 13.1252962 15.686054 1000 1.336532 1.5
7 416.48659 19.3715508 18.8005066 21.7607066 20.162013 3000 1.336532 1.5
8 861.70294 24.0843514 23.8113156 39.8882084 25.152138 3000 1.336532 1.5
9 1105.20222 24.7927750 25.0045538 47.2964660 26.344397 3000 1.336532 1.5
10 1356.10582 25.3376665 25.8021657 53.9109485 27.141449 3000 1.336532 1.5
Tleaf Cc PPFD Patm Ci_original
1 33.36515 72.81616 1800 100 72.81690
2 33.34065 89.33852 1800 100 89.33801
3 33.31123 119.73489 1800 100 119.73218
4 33.29358 163.84998 1800 100 163.84422
5 33.29326 219.62646 1800 100 219.61709
6 33.27833 259.25394 1800 100 259.24215
7 33.32764 416.50541 1800 100 416.48659
8 33.35583 861.72678 1800 100 861.70294
9 33.42005 1105.22725 1800 100 1105.20222
10 33.55434 1356.13165 1800 100 1356.10582
Root mean squared error: 0.9298254
Estimated parameters:
Estimate Std. Error
Vcmax 46.846621 1.4748353
Jmax 105.239159 1.3586480
Rd 1.336532 0.2413795
Note: Vcmax, Jmax are at 25C, Rd is at measurement T.
Curve was fit using method: default
Parameter settings:
Patm = 100
alpha = 0.24
theta = 0.85
EaV = 82620.87
EdVC = 0
delsC = 645.1013
EaJ = 39676.89
EdVJ = 2e+05
delsJ = 641.3615
Estimated from Tleaf (shown at mean Tleaf):
GammaStar = 64.80184
Km = 1460.068
Vcmax Jmax Rd
46.846621 105.239159 1.336532
[1] -0.7314466 0.5060336 2.7087379 5.7507507 9.3634028 11.7820610
[7] 18.8005066 23.8113156 25.0045538 25.8021657
Formula: ALEAF ~ acifun_wrap(Ci, PPFD = PPFD, Vcmax = Vcmax, Jmax = Jmax,
Rd = Rd, Tleaf = Tleaf, Patm = Patm, TcorrectVJ = Tcorrect,
alpha = alpha, theta = theta, gmeso = gmeso, EaV = EaV, EdVC = EdVC,
delsC = delsC, EaJ = EaJ, EdVJ = EdVJ, delsJ = delsJ, Km = Km,
GammaStar = GammaStar)
Parameters:
Estimate Std. Error t value Pr(>|t|)
Vcmax 46.8466 1.4748 31.764 7.92e-09 ***
Jmax 105.2392 1.3586 77.459 1.57e-11 ***
Rd 1.3365 0.2414 5.537 0.000872 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.3514 on 7 degrees of freedom
Number of iterations to convergence: 3
Achieved convergence tolerance: 1.714e-06
'nlstools' has been loaded.
IMPORTANT NOTICE: Most nonlinear regression models and data set examples
related to predictive microbiolgy have been moved to the package 'nlsMicrobio'
------
Formula: ALEAF ~ acifun_wrap(Ci, PPFD = PPFD, Vcmax = Vcmax, Jmax = Jmax,
Rd = Rd, Tleaf = Tleaf, Patm = Patm, TcorrectVJ = Tcorrect,
alpha = alpha, theta = theta, gmeso = gmeso, EaV = EaV, EdVC = EdVC,
delsC = delsC, EaJ = EaJ, EdVJ = EdVJ, delsJ = delsJ, Km = Km,
GammaStar = GammaStar)
Parameters:
Estimate Std. Error t value Pr(>|t|)
Vcmax 46.8466 1.4748 31.764 7.92e-09 ***
Jmax 105.2392 1.3586 77.459 1.57e-11 ***
Rd 1.3365 0.2414 5.537 0.000872 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.3514 on 7 degrees of freedom
Number of iterations to convergence: 3
Achieved convergence tolerance: 1.714e-06
------
Residual sum of squares: 0.865
------
t-based confidence interval:
2.5% 97.5%
Vcmax 43.3591894 50.334052
Jmax 102.0264667 108.451851
Rd 0.7657604 1.907304
------
Correlation matrix:
Vcmax Jmax Rd
Vcmax 1.0000000 0.6452788 0.8059230
Jmax 0.6452788 1.0000000 0.8043562
Rd 0.8059230 0.8043562 1.0000000
Ci ALEAF GS ELEAF Ac Aj Ap Rd VPD Tleaf Ca
1 820 23.54216 0 0 38.48885 24.88324 3000 1.336532 1.5 33.35401 400
Cc PPFD Patm
1 820.0236 1800 100
[1] 17.35755
[1] 382.6943
Result of fitaci.
Data and predictions:
Ci Ameas Amodel Ac Aj Ap Rd VPD Tleaf
1 72.81690 -0.6656991 -1.35292721 0.6471405 1.265786 1000 2 1.5 33.36515
2 89.33801 0.6089389 -0.02958141 1.9706558 3.607041 1000 2 1.5 33.34065
3 119.73218 2.4030110 2.32594382 4.3266181 7.101311 1000 2 1.5 33.31123
4 163.84422 5.5908708 5.57892434 7.5806664 10.876157 1000 2 1.5 33.29358
5 219.61709 9.2532753 9.44169960 11.4463234 14.273001 1000 2 1.5 33.29326
6 259.24215 12.0213403 12.02670039 14.0361824 16.101670 1000 2 1.5 33.27833
7 416.48659 19.3715508 18.67972602 23.2708841 20.696230 3000 2 1.5 33.32764
8 861.70294 24.0843514 23.81462284 42.6564214 25.818580 3000 2 1.5 33.35583
9 1105.20222 24.7927750 25.03933790 50.5788068 27.042444 3000 2 1.5 33.42005
10 1356.10582 25.3376665 25.85805505 57.6523296 27.860660 3000 2 1.5 33.55434
Cc PPFD Patm Ci_original
1 72.81554 1800 100 72.81690
2 89.33798 1800 100 89.33801
3 119.73451 1800 100 119.73218
4 163.84981 1800 100 163.84422
5 219.62654 1800 100 219.61709
6 259.25419 1800 100 259.24215
7 416.50529 1800 100 416.48659
8 861.72678 1800 100 861.70294
9 1105.22728 1800 100 1105.20222
10 1356.13171 1800 100 1356.10582
Root mean squared error: 1.343346
Estimated parameters:
Estimate Std. Error
Vcmax 50.09774 1.181665
Jmax 108.26249 1.095321
Rd 2.00000 NA
Note: Vcmax, Jmax are at 25C, Rd is at measurement T.
Note: measured Rd was provided, only Vcmax and Jmax were fit.
Curve was fit using method: default
Parameter settings:
Patm = 100
alpha = 0.24
theta = 0.85
EaV = 82620.87
EdVC = 0
delsC = 645.1013
EaJ = 39676.89
EdVJ = 2e+05
delsJ = 641.3615
Estimated from Tleaf (shown at mean Tleaf):
GammaStar = 64.80184
Km = 1460.068
Rd found in dataset but useRd set to FALSE. Set to TRUE to use measured Rd.
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.