
rTPC is an R package that helps fit thermalperformance curves (TPCs) in R.rTPC contains 24 modelformulations previously used to fit TPCs and has helper functions tohelp set sensible start parameters, upper and lower parameter limits andestimate parameters useful in downstream analyses, such as cardinaltemperatures, maximum rate and optimum temperature.
The idea behindrTPC is to make fitting thermalperformance curves easier, to provide workflows and examples of fittingTPCs without saying which model works best. Which model and whichworkflow is “best” is going to be down to the question that is beingasked. Throughout the vignettes,Things to consider sectionsgive some key considerations about what to considerbefore andduring the analysis.
When developingrTPC, we made a conscious decisionnot to repeat code and methods that are already optimised and availablein the R ecosystem. Consequently, the workflows take advantage ofnls.multstartfor fitting non-linear least squares regression and packages from thetidyverse for datamanipulation, fitting multiple models, and visualisation. The R packagecaris used extensively for the bootstrapping approaches.
rTPC and the pipelines outlined in the vignettes arepublished inMethodsin Ecology and Evolution and are open access. If this R packagehelps you, please cite us using the following citation:
Daniel Padfield, Hannah O’Sullivan, & Samraat Pawar (2021). rTPCand nls.multstart: A new pipeline to fit thermal performance curves inR. Methods in Ecology and Evolution.https://doi.org/10.1111/2041-210X.13585
Please report any bugs and suggestions to theIssues or emaild.padfield@exeter.ac.uk.This could be requests for the inclusion of a new mathematical modelformulation.
rTPC can easily be downloaded from GitHub using theremotes::install_github(). The vignettes are all availableonline, but if you would like to build them locally, addbuild_vignettes = TRUE into yourinstall_github() command. However, we do not recommenddoing this due to the number of extra R packages utilised in thevignettes.
# install package from GitHubremotes::install_github("padpadpadpad/rTPC")rTPC makes it easy to fit multiple models tomultiple thermal performance curves.

Figure 1. General pipeline for fitting thermal performancecurves using rTPC. (1) Collect, check, and manipulate data intolong format. (2) Choose which models from rTPC are going to be used.Here, a random assortment of four models were chosen. (3) Fit the modelsto data using nls.multstart and helper functions from rTPC. (4) Modelscan be visualised and (5) common traits of TPCs can be estimated usingrTPC::calc_params(). (6) This simple pipeline caneasily be scaled up to be used on multiple curves.
rTPC can also be easily used to do a number ofcommon tasks needed when fitting TPCs, such as model selection, modelaveraging, incorporating model weights and bootstrapping of modelfits.

Figure 2. Potential applications for fitting thermalperformance curves using rTPC. (1) AIC, BIC or other metrics ofmodel fit can be calculated to help to allow model selection or modelaveraging. (2) If TPCs are being fit to averages of multiple replicates,then weighted NLLS can be used that reduce parameter bias. (3) After themodel has been fitted, non-parametric bootstrapping approaches can helpestimate model uncertainty and calculate confidence intervals ofparameters.
vignette("rTPC")vignette("fit_many_models") andvignette("fit_many_curves").vignette("model_averaging_selection"),vignette("model_weighting"),vignette("bootstrapping_models"),vignette("weighted_bootstrapping"), andvignette("bootstrapping_many_curves").