trps

Bayesian trophic position models using Stan by leveraging {brms}

https://github.com/benjaminhlina/trps

Science Score: 49.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 15 DOI reference(s) in README
  • Academic publication links
    Links to: wiley.com
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.1%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Bayesian trophic position models using Stan by leveraging {brms}

Basic Info
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created over 1 year ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



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

# trps trps website
  

[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![CRAN status](https://www.r-pkg.org/badges/version/trps)](https://CRAN.R-project.org/package=trps)
[![trps status badge](https://benjaminhlina.r-universe.dev/trps/badges/version)](https://benjaminhlina.r-universe.dev/trps)
[![R-CMD-check](https://github.com/benjaminhlina/trps/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/benjaminhlina/trps/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/benjaminhlina/trps/graph/badge.svg)](https://app.codecov.io/gh/benjaminhlina/trps)

  

Bayesian trophic position models using Stan (pronounced tropes) by leveraging [{brms}](https://paulbuerkner.com/brms/). Equations for trophic position models are derived from [Post (2002)](https://esajournals.onlinelibrary.wiley.com/doi/abs/10.1890/0012-9658%282002%29083%5B0703%3AUSITET%5D2.0.CO%3B2), [Vander Zanden and Vadeboncoeur (2002)](https://esajournals.onlinelibrary.wiley.com/doi/full/10.1890/0012-9658%282002%29083%5B2152%3AFAIOBA%5D2.0.CO%3B2), and [Heuvel et al. (2024)](https://doi.org/10.1139/cjfas-2024-0028) and are to be used with stable isotope data.  

## 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 ($\alpha_r$) - `two_source_model_ar()`

4) Two Source Model - $\alpha$ corrected ($\alpha_r$) - carbon mixing model - 
`two_source_model_arc()`


## Installation

You can install the [CRAN version](https://CRAN.R-project.org/package=trps) of 
{trps} using the following:

``` r
install.packages("trps")
  
```
You can install the 
[R-Universe version](https://benjaminhlina.r-universe.dev/trps) of {trps} using 
the following:

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

You can install the [development version](https://github.com/benjaminhlina/trps) 
of {trps} using the following:

``` r
devtools::install_github("benjaminhlina/trps")
```

To view the overall progress of the package please see 
[news](https://benjaminhlina.github.io/trps/news/index.html). 

## Vignettes 
### Introduction

I highly suggest going through the vignettes as they will walk you through 
how to use each trophic position model using {trps} and {brms}. The 
first vignette to walk through is [getting started with trps](https://benjaminhlina.github.io/trps/articles/trps.html). 
This vignette will introduce you to 
[{trps}](https://benjaminhlina.github.io/trps/) and how
to estimate trophic position using a one source model. You can access the 
vignette by visiting the
[get started](https://benjaminhlina.github.io/trps/articles/trps.html) 
page on the website or by 
using the following code. 

``` {r, message = FALSE, eval = FALSE}
vignette("trps")
```

Please go through
[getting started with trps](https://benjaminhlina.github.io/trps/articles/trps.html) 
prior to walking through the other vignettes. 

### Supplementary Vignettes 
 
1. The next vignette will walk you through how to apply 
[{trps}](https://benjaminhlina.github.io/trps/) with iterative
processes. This vignette is titled 
[Estimate Trophic Position - One Source Model - Multiple Groups](https://benjaminhlina.github.io/trps/articles/estimate_trophic_position_one_source_multiple_groups.html). 

2. The third vignette to walk through is 
[Estimating Trophic Postion - Two Source Model](https://benjaminhlina.github.io/trps/articles/estimate_trophic_position_two_source_model.html).
which will demonstrate how to estimate trophic position using a two source model. 

3. The last vignette to walk through is 
[Estimating Trophic Postion - Two Source Model - ar](https://benjaminhlina.github.io/trps/articles/estimate_trophic_position_two_source_model_ar.html). 
This vignette will guide you through estimating trophic position using a two 
source model using an equation based on [Heuvel et al. (2024)](https://doi.org/10.1139/cjfas-2024-0028)  that corrects (i.e., scales) $\alpha$ ($\alpha_r$).

## 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](https://esajournals.onlinelibrary.wiley.com/doi/full/10.1890/0012-9658%282002%29083%5B0703%3AUSITET%5D2.0.CO%3B2).

- Vander Zanden, M.J., and Vadeboncoeur, Y. 2002. Fishes as integrators of benthic and pelagic food webs in lakes. Ecology 83(8): 2152–2161. [link here](https://esajournals.onlinelibrary.wiley.com/doi/abs/10.1890/0012-9658(2002)083[2152:FAIOBA]2.0.CO;2).

- 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](https://doi.org/10.1139/cjfas-2024-0028).

- Andersen, A.M., P.J. Blanchfield, C.E. Heuvel, K.S. McCann, B.C. McMeans, M.S. Ridgway, and A.T. Fisk. 2025. Influence of lake volume on food web metrics in a freshwater fish assemblage across a small range of ecosystem sizes. Canadian Journal of Fisheries and Aquatic Sciences 82: 1–14. doi: [10.1139/cjfas-2024-0226](https://doi.org/10.1139/cjfas-2024-0226)

- Hlina B.L. 2025. trps: Bayesian Trophic Position Models using 'Stan'. R package 
version 0.1.0 ('one-skate'). https://benjaminhlina.github.io/trps/

Owner

  • Name: Benjamin Hlina
  • Login: benjaminhlina
  • Kind: user
  • Location: Ottawa, ON, CA
  • Company: Carleton University

PhD Candidate @ Fish Ecology and Conservation Physiology Laboratory working on understanding spatial ecology of fish

GitHub Events

Total
  • Release event: 1
  • Public event: 1
  • Push event: 346
  • Create event: 2
Last Year
  • Release event: 1
  • Public event: 1
  • Push event: 346
  • Create event: 2

Packages

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

Bayesian Trophic Position Models using 'stan'

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 158 Last month
Rankings
Dependent packages count: 27.0%
Dependent repos count: 33.2%
Average: 49.1%
Downloads: 87.0%
Maintainers (1)
Last synced: 10 months ago

Dependencies

.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.5.0 composite
  • actions/checkout v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • codecov/codecov-action v4 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • brms * imports
  • cli * imports
  • dplyr * imports
  • lifecycle * imports
  • testthat >= 3.0.0 suggests