rtpc

R package to help fit Thermal Performance Curves

https://github.com/padpadpadpad/rtpc

Science Score: 39.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.5%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

R package to help fit Thermal Performance Curves

Basic Info
Statistics
  • Stars: 27
  • Watchers: 3
  • Forks: 5
  • Open Issues: 6
  • Releases: 2
Created about 7 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: 
  github_document:
    pandoc_args: --webtex
always_allow_html: yes
---



```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# rTPC 



[![R-CMD-check](https://github.com/padpadpadpad/rTPC/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/padpadpadpad/rTPC/actions/workflows/R-CMD-check.yaml) [![CRAN status](https://www.r-pkg.org/badges/version/rTPC)](https://CRAN.R-project.org/package=rTPC) [![Downloads from Rstudio mirror](https://cranlogs.r-pkg.org/badges/grand-total/rTPC)](https://www.r-pkg.org/pkg/rTPC)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)



**rTPC** is an R package that helps fit thermal performance curves (TPCs) in R. **rTPC** contains `r length(rTPC::get_model_names())` model formulations previously used to fit TPCs and has helper functions to help set sensible start parameters, upper and lower parameter limits and estimate parameters useful in downstream analyses, such as cardinal temperatures, maximum rate and optimum temperature.

The idea behind **rTPC** is to make fitting thermal performance curves easier, to provide workflows and examples of fitting TPCs without saying which model works best. Which model and which workflow is "best" is going to be down to the question that is being asked. Throughout the vignettes, *Things to consider* sections give some key considerations about what to consider *before* and *during* the analysis.

When developing **rTPC**, we made a conscious decision not to repeat code and methods that are already optimised and available in the R ecosystem. Consequently, the workflows take advantage of [**nls.multstart**](https://github.com/padpadpadpad/nls.multstart) for fitting non-linear least squares regression and packages from the [**tidyverse**](https://www.tidyverse.org) for data manipulation, fitting multiple models, and visualisation. The R package [**car**](https://CRAN.R-project.org/package=car/car.pdf) is used extensively for the bootstrapping approaches.

**rTPC** and the pipelines outlined in the vignettes are published in [Methods in Ecology and Evolution](https://doi.org/10.1111/2041-210X.13585) and are open access. 

## Citation

If this R package helps you, please cite the R package:

Padfield D, O'Sullivan H, Windram F (2024). *rTPC: Fitting and Analysing Thermal Performance Curves*. R package version 1.0.7, , 

This allows all developers of the package to get credit for the work they are doing, since Francis Windram was key to driving the development and improvement of **rTPC** after the publication in MEE.

You can also cite the publication in Methods in Ecology and Evolution, but please cite the R packages **rTPC** and **nls.multstart** as well:

Daniel Padfield, Hannah O'Sullivan, & Samraat Pawar (2021). rTPC and nls.multstart: A new pipeline to fit thermal performance curves in R. Methods in Ecology and Evolution. 

## Bugs and suggestions

Please report any bugs and suggestions to the [Issues](https://github.com/padpadpadpad/rTPC/issues) or email [d.padfield\@exeter.ac.uk](mailto:d.padfield@exeter.ac.uk){.email}. This could be requests for the inclusion of a new mathematical model formulation.

## Installation

The devlopment version of **rTPC** - which likely includes up to date fixes and new models - can be installed from GitHub using the `remotes::install_github()`. The vignettes are all available online, but if you would like to build them locally, add `build_vignettes = TRUE` into your `install_github()` command. However, we do not recommend doing this due to the number of extra R packages utilised in the vignettes.

```{r install, eval = FALSE}
# install package from GitHub
remotes::install_github("padpadpadpad/rTPC")
```

**rTPC** can also easily be downloaded from CRAN.

```{r install_cran, eval = FALSE}
# install package from CRAN
install.packages('rTPC')
```

## General pipeline

**rTPC** makes it easy to fit multiple models to multiple thermal performance curves.



**Figure 1. General pipeline for fitting thermal performance curves using rTPC**. (1) Collect, check, and manipulate data into long format. (2) Choose which models from rTPC are going to be used. Here, a random assortment of four models were chosen. (3) Fit the models to data using nls.multstart and helper functions from rTPC. (4) Models can be visualised and (5) common traits of TPCs can be estimated using **rTPC::calc_params()**. (6) This simple pipeline can easily be scaled up to be used on multiple curves.

## Extensions to the pipeline

**rTPC** can also be easily used to do a number of common tasks needed when fitting TPCs, such as model selection, model averaging, incorporating model weights and bootstrapping of model fits.



**Figure 2. Potential applications for fitting thermal performance curves using rTPC**. (1) AIC, BIC or other metrics of model fit can be calculated to help to allow model selection or model averaging. (2) If TPCs are being fit to averages of multiple replicates, then weighted NLLS can be used that reduce parameter bias. (3) After the model has been fitted, non-parametric bootstrapping approaches can help estimate model uncertainty and calculate confidence intervals of parameters.

## Getting started

-   For an introduction to **rTPC**, see `vignette("rTPC")`
-   To follow the general pipeline, see `vignette("fit_many_models")` and `vignette("fit_many_curves")`.
-   For examples of extensions to this pipeline, see the `vignette("model_averaging_selection")`, `vignette("model_weighting")`, `vignette("bootstrapping_models")`, `vignette("weighted_bootstrapping")`, and `vignette("bootstrapping_many_curves")`.

Owner

  • Name: Daniel Padfield
  • Login: padpadpadpad
  • Kind: user
  • Location: Cornwall
  • Company: University of Exeter

GitHub Events

Total
  • Issues event: 28
  • Watch event: 5
  • Delete event: 1
  • Issue comment event: 82
  • Push event: 95
  • Pull request event: 10
  • Fork event: 1
Last Year
  • Issues event: 28
  • Watch event: 5
  • Delete event: 1
  • Issue comment event: 82
  • Push event: 95
  • Pull request event: 10
  • Fork event: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 11
  • Total pull requests: 3
  • Average time to close issues: 15 days
  • Average time to close pull requests: about 6 hours
  • Total issue authors: 3
  • Total pull request authors: 2
  • Average comments per issue: 3.0
  • Average comments per pull request: 0.33
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 11
  • Pull requests: 3
  • Average time to close issues: 15 days
  • Average time to close pull requests: about 6 hours
  • Issue authors: 3
  • Pull request authors: 2
  • Average comments per issue: 3.0
  • Average comments per pull request: 0.33
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • fwimp (8)
  • padpadpadpad (6)
  • juanharagon (1)
  • HaleyAddison (1)
  • BridgSUN (1)
Pull Request Authors
  • fwimp (5)
  • padpadpadpad (1)
  • olivroy (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 308 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: rTPC

Fitting and Analysing Thermal Performance Curves

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 308 Last month
Rankings
Stargazers count: 12.7%
Forks count: 14.5%
Dependent packages count: 28.3%
Average: 36.1%
Dependent repos count: 36.9%
Downloads: 87.9%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
DESCRIPTION cran
  • R >= 2.10 depends
  • stats * imports
  • MuMIn * suggests
  • RColorBrewer * suggests
  • boot * suggests
  • broom * suggests
  • car * suggests
  • forcats * suggests
  • ggplot2 * suggests
  • ggrepel * suggests
  • knitr * suggests
  • minpack.lm * suggests
  • nls.multstart * suggests
  • nlstools * suggests
  • patchwork * suggests
  • progress * suggests
  • rmarkdown * suggests
  • stringr * suggests
  • testthat * suggests
  • tidyverse * suggests
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite