Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

DOI Coverage Status


tRophicPosition is a colaborative project of Chris Harrod, Andrew L. Jackson, Claudio Quezada-Romegialli and others. It consists of an R package incorporating a Bayesian model for the calculation of consumer trophic position using stable isotopes with one or two baselines. It uses the powerful approach of Markov Chain Monte Carlo simulations provided by JAGS and the statistical language R.

As of 5th of April 2019, we are releasing the version 0.7.7 of the package, the fifth release version. If you find any error, please send it to and/or raise an issue in the GitHub page. Also you can also send a direct email to clquezada at

If you are interested in joining the tRophicPosition support group, do it at

NEWS (05 April 2019)

  • Updating CRAN release to v 0.7.7 (archived recently). Small fix regarding examples.

NEWS (27 June 2018)

  • Fixed issue 69 (parametricTP() when using only one baseline). This small fix changes current version of tRophicPosition to 0.7.6 only in GitHub. CRAN version will be updated soon.

NEWS (29 January 2018)

  • Added the function extractPredictiveData() to perform a posterior predictive model-checking procedure.
  • Implemented code coverage and unit test.
  • Improved the code (to make it clearer, considering width and the assignment operator).
  • Changed some arguments (consumer instead of species, group instead of community and others) in loadIsotopeData(), extractIsotopeData() and other functions (while maintaining old arguments as compatibility)
  • Added a a procedure for checking errors on priors arguments in jagsBayesianModel and related functions
  • Removed MCMCvis from the Short guide to tRophicPosition vignette, as that package is no longer in CRAN.

NEWS (12 October 2017)

  • Added the function fromParallelTP() to extract the data from parallel calculations (see the examples on GitHub).
  • Implemented the Bhattacharrya Coefficient (from the package dispRity) when comparing two or more posterior distributions. As dispRity is only available through GitHub, when users have not installed the package we use the internal function bhat.coeff based on dispRity package.
  • Improved credibilityIntervals(). Now it can group samples by colour, accept manual colours and legend position.
  • Added two example datasets: Inari and Kilpis (Finnish_Lakes), and Roach, and including some examples in the GitHub page.


The stable version of tRophicPosition is hosted on CRAN, and is installed like any other package:


Remember to install JAGS for your platform as well. A number of packages are needed, which can be installed with:

install.packages(c("coda", "data.table", "dplyr", "ggplot2", "gridExtra",
"hdrcde", "MCMCglmm", "plyr", "rjags", "knitr", "rmarkdown"))

The development version of tRophicPosition must be installed from GitHub. For this, install the package devtools, and then use the function install_github():

devtools::install_github("clquezada/tRophicPosition", build_vignettes = TRUE)

And then see the vignettes we have prepared to describe how to use the package:


Online vignettes

Can be found in GitHub here.


tRophicPosition relies on some code from coda and dispRity. At the moment dispRity is only available through GitHub, so it is not included in Suggests. tRophicPosition included the Bhattacharrya Coefficient (bhatt.coeff function from dispRity) and plotMCMC (from coda) for convenience.


When citing tRophicPosition in publications, please cite both the paper describing the method and the package version you used to analyse your data:

Claudio Quezada-Romegialli, Andrew L Jackson, Brian Hayden, Kimmo K Kahilainen, Christelle Lopes and Chris Harrod (2018). tRophicPosition , an R package for the Bayesian estimation of trophic position from consumer stable isotope ratios. Methods in Ecology and Evolution, 9(6):1592-1599. doi:10.1111/2041-210X.13009

Claudio Quezada-Romegialli, Andrew L Jackson, Brian Hayden, Kimmo K Kahilainen, Christelle Lopes and Chris Harrod (2018). tRophicPosition: Bayesian Trophic Position Calculation with Stable Isotopes. R package version 0.7.5. doi:10.5281/zenodo.1161826

For previous releases please use the corresponding version and doi when citing:

Future releases and how to get support

You are encouraged to use tRophicPosition with your own data, test the package and see if there are any issues or problems. You can send your questions or commentaries to the google group tRophicPosition-support or directly to the email trophicposition-support at You can send your questions to or even Facebook (stable isotope ecology group).

We are constantly working on future releases of tRophicPosition, so feedback is very much appreciated.


Things to do in tRophicPosition


estimate trophic position using stable isotope data



No packages published