Title: | Temperature Response |
---|---|
Description: | Fits temperature response models to rate measurements taken at different temperatures. |
Authors: | Etienne Low-Decarie [aut, cre] |
Maintainer: | Etienne Low-Decarie <[email protected]> |
License: | GPL-3 |
Version: | 0.2 |
Built: | 2024-11-08 03:11:41 UTC |
Source: | https://github.com/low-decarie/temperatureresponse |
Helper function that add terms to the broom output of fit
amend_output(output, fit, f_equ, temp, rate, try_test, augment, return_fit)
amend_output(output, fit, f_equ, temp, rate, try_test, augment, return_fit)
output |
broom output of fit |
fit |
the model output of the fitting process |
f_equ |
equation with fitted parameters |
temp |
temperature values of measurements |
rate |
rate that changes with temperature |
try_test |
did the model fitting succeed or produce an error? |
augment |
add columns to the original dataset such as predictions, residuals and cluster assignments using package::broom (T/F)? |
return_fit |
return the model object (T/F)? |
a data frame of, depending on augment argument, if FALSE, parameters, if TRUE, data with predicted values
A data set containing the temperature response of the growth rate of Emiliania_huxleyi
Emiliania_huxleyi
Emiliania_huxleyi
A data frame with 39 rows and 3 variables:
temperature
growth rate
...
Equation from Thomas et al. (2014)
equ10(temp, rate, augment = F, return_fit = F)
equ10(temp, rate, augment = F, return_fit = F)
temp |
temperature (in Celsius) |
rate |
rate measurement |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
return_fit |
logical wether the model fit object should be returned |
a data frame of, depending on augment argument, if FALSE, parameters, if TRUE, data with predicted values
#output <- with(Emiliania_huxleyi, equ10(temp=temp, rate=rate))
#output <- with(Emiliania_huxleyi, equ10(temp=temp, rate=rate))
Equation in Montagnes et al. 2008
equ11(temp, rate, augment = F, return_fit = F)
equ11(temp, rate, augment = F, return_fit = F)
temp |
temperature (in Celsius) |
rate |
rate measurement |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
return_fit |
logical wether the model fit object should be returned |
depends on augment: if false, fitting parameters or fitted data
output <- with(Emiliania_huxleyi, equ11(temp=temp, rate=rate))
output <- with(Emiliania_huxleyi, equ11(temp=temp, rate=rate))
Equation in Montagnes et al (2008) citing Flinn (1991)
equ12(temp, rate, augment = F, return_fit = F)
equ12(temp, rate, augment = F, return_fit = F)
temp |
temperature (in Celsius) |
rate |
rate measurement |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
return_fit |
logical wether the model fit object should be returned |
depends on augment: if false, fitting parameters or fitted data
output <- with(Emiliania_huxleyi, equ12(temp=temp, rate=rate))
output <- with(Emiliania_huxleyi, equ12(temp=temp, rate=rate))
Equation in Ratkowsky et al. (1983)
equ13(temp, rate, augment = F, return_fit = F)
equ13(temp, rate, augment = F, return_fit = F)
temp |
temperature (in Celsius) |
rate |
rate measurement |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
return_fit |
logical wether the model fit object should be returned |
depends on augment: if false, fitting parameters or fitted data
output <- with(Emiliania_huxleyi, equ14(temp=temp, rate=rate))
output <- with(Emiliania_huxleyi, equ14(temp=temp, rate=rate))
Equation from Kamykowski (1985)
equ14(temp, rate, augment = F, return_fit = F)
equ14(temp, rate, augment = F, return_fit = F)
temp |
temperature (in Celsius) |
rate |
rate measurement |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
return_fit |
logical wether the model fit object should be returned |
a data frame of, depending on augment argument, if FALSE, parameters, if TRUE, data with predicted values
New equation (based on sine)
equ15(temp, rate, augment = F, return_fit = F)
equ15(temp, rate, augment = F, return_fit = F)
temp |
temperature (in Celsius) |
rate |
rate measurement |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
return_fit |
logical wether the model fit object should be returned |
a data frame of, depending on augment argument, if FALSE, parameters, if TRUE, data with predicted values
output <- with(Emiliania_huxleyi, equ15(temp=temp, rate=rate))
output <- with(Emiliania_huxleyi, equ15(temp=temp, rate=rate))
Equation from "A Key Marine Diazotroph in a Changing Ocean: The Interacting Effects of Temperature, CO2 and Light on the Growth of Trichodesmium erythraeum IMS101". Challenging to fit to many datasets. Does not fit to example dataset.
equ16(temp, rate, augment = F, return_fit = F)
equ16(temp, rate, augment = F, return_fit = F)
temp |
temperature (in Celsius) |
rate |
rate measurement |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
return_fit |
logical wether the model fit object should be returned |
a data frame of, depending on augment argument, if FALSE, parameters, if TRUE, data with predicted values
output <- with(Emiliania_huxleyi, equ16(temp=temp, rate=rate))
output <- with(Emiliania_huxleyi, equ16(temp=temp, rate=rate))
Equation 4 is model H in Li & Dickie (1987) citing Hinshelwood (1947)
equ4(temp, rate, augment = F, return_fit = F)
equ4(temp, rate, augment = F, return_fit = F)
temp |
temperature (in Celsius) |
rate |
rate measurement |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
return_fit |
logical wether the model fit object should be returned |
a data frame of, depending on augment argument, if FALSE, parameters, if TRUE, data with predicted values
output <- with(Emiliania_huxleyi, equ4(temp=temp, rate=rate))
output <- with(Emiliania_huxleyi, equ4(temp=temp, rate=rate))
Equation 5 is model J from Li & Dickie (1987) citing Johnson et al. (1942) Does not currently work
equ5(temp, rate, augment = F, return_fit = F)
equ5(temp, rate, augment = F, return_fit = F)
temp |
temperature (in Celsius) |
rate |
rate measurement |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
return_fit |
logical wether the model fit object should be returned |
a data frame of, depending on augment argument, if FALSE, parameters, if TRUE, data with predicted values
output <- with(Emiliania_huxleyi, equ5(temp=temp, rate=rate))
output <- with(Emiliania_huxleyi, equ5(temp=temp, rate=rate))
Equation 6
equ6(temp, rate, augment = F, return_fit = F)
equ6(temp, rate, augment = F, return_fit = F)
temp |
temperature (in Celsius) |
rate |
rate measurement |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
return_fit |
logical wether the model fit object should be returned |
a data frame of, depending on augment argument, if FALSE, parameters, if TRUE, data with predicted values
output <- with(Emiliania_huxleyi, equ6(temp=temp, rate=rate))
output <- with(Emiliania_huxleyi, equ6(temp=temp, rate=rate))
Equation 7 from Montagnes et al (2008) citing Schoolfield et al. (1981)
equ7(temp, rate, augment = F, return_fit = F)
equ7(temp, rate, augment = F, return_fit = F)
temp |
temperature (in Celsius) |
rate |
rate measurement |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
return_fit |
logical wether the model fit object should be returned |
a data frame of, depending on augment argument, if FALSE, parameters, if TRUE, data with predicted values
output <- with(Emiliania_huxleyi, equ7(temp=temp, rate=rate))
output <- with(Emiliania_huxleyi, equ7(temp=temp, rate=rate))
Equation in Li & Dickie (1987) citing Stoermer & Ladewski (1976): a*exp(-0.5*((temp-tref)/b)^2)
equ8(temp, rate, augment = F, plot_profile = F, return_fit = F)
equ8(temp, rate, augment = F, plot_profile = F, return_fit = F)
temp |
temperature (in celsius or Kelvin) |
rate |
rate measurement |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
plot_profile |
logical should the model fitting profile be plotted |
return_fit |
logical wether the model fit object should be returned |
depends on augment: if false, fitting parameters or fitted data
output <- with(Emiliania_huxleyi, equ8(temp=temp, rate=rate))
output <- with(Emiliania_huxleyi, equ8(temp=temp, rate=rate))
Equation from Montagnes et al. 2008
equ9(temp, rate, augment = F, return_fit = F)
equ9(temp, rate, augment = F, return_fit = F)
temp |
temperature (in Celsius) |
rate |
rate measurement |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
return_fit |
logical wether the model fit object should be returned |
a data frame of, depending on augment argument, if FALSE, parameters, if TRUE, data with predicted values
output <- with(Emiliania_huxleyi, equ9(temp=temp, rate=rate))
output <- with(Emiliania_huxleyi, equ9(temp=temp, rate=rate))
Fits list of models (all models in package by default)
fitmodellist(temp, rate, augment = F, return_fit = F, models = paste0("equ", 4:15))
fitmodellist(temp, rate, augment = F, return_fit = F, models = paste0("equ", 4:15))
temp |
temperature (in Celsius) |
rate |
rate measurement (for example growth rate, but could also be abundance) |
augment |
logical wether the dataset with fits should be returned instead of the parameter values |
return_fit |
logical should the model object be returned |
models |
list of strings of equations to be fit such as paste0("equ",4:15) |
a data frame of, depending on augment argument, if FALSE, parameters, if TRUE, data with predicted values
output <- with(Emiliania_huxleyi, fitmodellist(temp=temp, rate=rate))
output <- with(Emiliania_huxleyi, fitmodellist(temp=temp, rate=rate))