RemkoDuursma / plantecophys

Analysing and Modelling Leaf Gas Exchange Data in R
http://remkoduursma.github.io/plantecophys
16 stars 7 forks source link

Apply predict method in acifit objects #4

Closed GabrielSlPires closed 1 year ago

GabrielSlPires commented 1 year ago

Hello,

I wish to calculate my stomatal limitation, to do it I need to calculate An for Ci = 400. As you already have the equations to get A model, is it possible to make the acifit object an applicable method for 'predict'? I imagine that this could be a bit complicate to make your prediction decide which equation to use (Ac, Aj, Ap). So if that's the case, could you provide those three model as an item of acifit object? Because with it, I can predict An for Ci = 400. I suggested it because you have already done that for a nlsfit.

Best wishes, Gabriel

GabrielSlPires commented 1 year ago

Actually, another option to do it would be with your Aci function. I was able to add all my parameters from my acifit object and the wanted Ci. I think that this makes sense. If I'm right, would it be possible to make something to automatically send all your parameters of an acifti object to Aci function?

RemkoDuursma commented 1 year ago

This is already possible, see the examples in ?fitaci :

f <- fitaci(acidata1) f$Photosyn(Ci = 400)

The Photosyn function is embedded in the object returned by fitaci, with all parameters as used in the fit. With this method you can generate the entire A-Ci curve at any Ci.

hope that helps

GabrielSlPires commented 1 year ago

Nice, this is exactly what I was looking for. Thank you!