Learn R Programming

⚠️There's a newer version (0.8.0) of this package.Take me there.

tRophicPosition

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 29th of January 2018, we are releasing the version 0.7.5 of the package, the fourth release version. If you find any error, please send it to trophicposition-support@googlegroups.com and/or raise an issue in the GitHub page. Also you can also send a direct email to clquezada at harrodlab.net.

If you are interested in joining the tRophicPosition support group, do it at https://groups.google.com/d/forum/trophicposition-support

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.

Installation

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

install.packages("tRophicPosition")

Remember to install JAGS for your platform as well.

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

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

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

browseVignettes("tRophicPosition")

Online vignettes

Can be found in GitHub here.

Credits

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.

Citation

While the paper describing tRophicPosition is not published (currently under revision at MEE), to cite the package in publications please use:

Claudio Quezada-Romegialli, Andrew L Jackson and Chris Harrod (2018). tRophicPosition: Bayesian Trophic Position Calculation with Stable Isotopes. R package version 0.7.5. https://cran.r-project.org/package=tRophicPosition 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 googlegroups.com. You can send your questions to http://stackexchange.com/ http://stackoverflow.com/ or even Facebook (stable isotope ecology group).

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

To DO

Things to do in tRophicPosition

Copy Link

Version

Install

install.packages('tRophicPosition')

Monthly Downloads

49

Version

0.7.5

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Claudio Quezada-Romegialli

Last Published

January 29th, 2018

Functions in tRophicPosition (0.7.5)

Orestias

Named list containing stable isotope values of Orestias chungarensis
Roach

Data frame of Roach in Lough Neagh
compareTwoDistributions

Function to compare two distributions and test a hypothesis, in a Bayesian context
credibilityIntervals

Plot credibility intervals and central tendency descriptor from posterior distributions of trophic position and/or alpha parameter
TDF

Trophic discrimination factors from bibliography
TEF

Trophic enrichment factors from bibliography
TPmodel

Function to create a JAGS-based Bayesian model to calculate trophic position
Trout

Named list containing stable isotope values of Oncorhynchus mykiss
jagsOneBaseline

Defines a jags Bayesian model to fit a single baseline trophic position model
jagsTwoBaselines

Defines a jags Bayesian model to fit a two baselines trophic position model (without fractionation for C)
extractIsotopeData

Extract stable isotope data from a data frame
extractPredictiveData

Function to extract raw data from posterior predictive model-checking distributions
plotTP

Function to plot a trophic position distribution
getPosteriorMode

Function to get mode from a posterior distribution
jagsBayesianModel

Returns a JAGS-based Bayesian model to use within tRophicPosition.
plot.isotopeData

Plot stable isotope data (2 elements) with one or two baselines
plotMCMC

Internal function that plot a mcmc.list object.
fromParallelTP

Function to extract raw data from parallel calculations of trophic position
generateTPData

A function to generate random stable isotope data for trophic position calculation
pairwiseComparisons

Function to perform pairwise comparisons between two or more posterior distributions
posteriorTP

Function to generate posterior samples of a trophic position JAGS model
multiModelTP

Multiple model calculation of trophic position
multiSpeciesTP

Multiple species calculation of trophic position
trophicDensityPlot

Function to plot posterior samples of trophic position estimates
screenFoodWeb

Function that creates a biplot of a food web with stable isotope values (d13C and d15N)
screenIsotopeData

Function to plot and screen stable isotope data with one or more baselines.
simulateTDF

Simulate trophic discrimination factors
simulateTEF

Simulate trophic enrichment factors
Bilagay

Data frame containing stable isotope values of Bilagay.
Finnish_Lakes

Data frame of food webs in Inari and Kilpis Lakes (Finland)
jagsTwoBaselinesFull

Defines a jags Bayesian model to fit a two baselines trophic position full model (with fractionation for C)
loadIsotopeData

Extract and load stable isotope data for selected consumers from a data frame
parametricTP

Parametric trophic position
summariseIsotopeData

Function that summarises a data frame containing stable isotope values (d13C and d15N) grouping by Species and FG columns
summary.isotopeData

Summary for stable isotope data