Skip to contents

Bayesian trophic position models using stan (pronounced trips) by leveraging {brms}. Equations for trophic position models are derived from Post 2002 and Heuvel et al. 2024 and are to be used with stable isotope data for different species.

Trophic Models in {trps}

Currently {trps} supports the following models:

  1. One Source Model - one_source_model()

  2. Two Source Model - two_source_model()

  3. Two Source Model - α\alpha corrected (αr\alpha_r) using Heuvel et al. 2024 - two_source_model_ar()

  4. Two Source Model - α\alpha corrected (αr\alpha_r) - with carbon mixing model - two_source_model_arc()

Installation

You can install the R-Universe version of {trps} using the following:

install.packages("trps", 
                  repos = c("https://benjaminhlina.r-universe.dev",
                            "https://cloud.r-project.org"))

You can install the development version of {trps} using the following:

devtools::install_github("benjaminhlina/trps")

To view the overall progress of the package please see news.

Vignettes

I highly suggest going through the vignettes as they will walk you through how to use create each trophic position model using {trps} and {brms}.

vignette("estimate_trophic_position_one_source_model")

You can also use the following to see vignettes:

The vignettes are currently available online under the articles section of the website. See the following links, Estimate trophic position - one source.

Citations

To cite this package please cite the following publications

  • Post, D.M. 2002. Using Stable Isotopes to Estimate Trophic Position: Models, Methods, and Assumptions. Ecology 83(3): 703-718. doi: 10.2307/3071875.

  • Heuvel, C., Zhao, Y., and Fisk, A.T. 2025. Food web structure across basins in Lake Erie, a large freshwater ecosystem. Canadian Journal of Fisheries and Aquatic Sciences 82:1-16. doi: 10.1139/cjfas-2024-0028.

  • Hlina B.L. 2025. trps: Bayesian trophic position models using stan. R package version 0.1.0 (‘one-skate’). https://benjaminhlina.github.io/trps/