Bayesian Trophic Position Models using 'stan'
Overview
Bayesian trophic position models using 'stan' by leveraging 'brms' for stable isotope data. Trophic position models are derived by using equations from Post (2002) doi:10.1890/0012-9658(2002)083[0703:USITET]2.0.CO;2, Vander Zanden and Vadeboncoeur (2002) doi:10.1890/0012-9658(2002)083[2152:FAIOBA]2.0.CO;2, and Heuvel et al. (2024) doi:10.1139/cjfas-2024-0028.
18-Mar-2025
- [x] a one-source model
- [x] priors for a one-source model
- [x] parameters for priors for a one-source model
- [x] a two-source model without different lambda
- [x] priors for a two-source model without different lambda
- [x] parameters for priors for a two-source model without different lambda
- [x] a two-source model with different lambda
- [x] priors for two-source model w/ different lambda (priors are the same as
a two-source)
- [x] parameters for priors for a two-source model w/ different lambda (priors are the same as a two-source)
- [x] a two-source carbon mixing model
Show all changes in 0.1.0Hide the rest of the changes in 0.1.0
- [x] priors and parameters for priors
- [x] a two-source model with different lambdas and alpha corrected using Heuvel et al. 2024.
- [x] priors
- [x] parameters for priors
- [x] vignettes for one source
- [x] vignettes for two source
- [x] vignettes for twp source ar
17-Mar-2025
- [x] a one-source model
- [x] priors for a one-source model
- [x] parameters for priors for a one-source model
- [x] a two-source model without different lambda
- [x] priors for a two-source model without different lambda
- [x] parameters for priors for a two-source model without different lambda
- [x] a two-source model with different lambda
- [x] priors for two-source model w/ different lambda (priors are the same as
a two-source)
- [x] parameters for priors for a two-source model w/ different lambda (priors are the same as a two-source)
- [x] a two-source carbon mixing model
- [x] priors and parameters for priors
- [x] a two-source model with different lambdas and alpha corrected using Heuvel et al. 2024.
- [x] priors
- [x] parameters for priors
- [x] vignettes for one source
- [x] vignettes for two source
- [] vignettes for twp source ar
14-Mar-2025
- [x] a one-source model
- [x] priors for a one-source model
- [x] parameters for priors for a one-source model
- [x] a two-source model without different lambda
- [x] priors for a two-source model without different lambda
- [x] parameters for priors for a two-source model without different lambda
- [x] a two-source model with different lambda
- [x] priors for two-source model w/ different lambda (priors are the same as
a two-source)
- [x] parameters for priors for a two-source model w/ different lambda (priors are the same as a two-source)
- [x] a two-source carbon mixing model
- [x] priors and parameters for priors
- [x] a two-source model with different lambdas and alpha corrected using Heuvel et al. 2024.
- [x] priors
- [x] parameters for priors
- [x] vignettes for one source
- [] vignettes for two source
- [] vignettes for twp source ar
Fixed two source model as it wasn't accurately
estimating $\alpha$ as the formula for $\alpha$
was not part of the model structure, priors,
and parameters.
28-Feb-2025
- [x] a one-source model
- [x] priors for a one-source model
- [x] parameters for priors for a one-source model
- [x] a two-source model without different lambda
- [x] priors for a two-source model without different lambda
- [x] parameters for priors for a two-source model without different lambda
- [x] a two-source model with different lambda
- [x] priors for two-source model w/ different lambda (priors are the same as
a two-source)
- [x] parameters for priors for a two-source model w/ different lambda (priors are the same as a two-source)
- [] a two-source carbon mixing model
- [] priors and parameters for priors
- [x] a two-source model with different lambdas and alpha corrected using Heuvel et al. 2024.
- [x] priors
- [] parameters for priors
- [x] vignettes for one source
- [] vignettes for two source
- [] vignettes for twp source ar
16-Feb-2025
- [x] a one-source model
- [x] priors for a one-source model
- [x] parameters for priors for a one-source model
- [x] a two-source model without different lambda
- [x] priors for a two-source model without different lambda
- [x] parameters for priors for a two-source model without different lambda
- [] a two-source model with different lambda
- [] priors for two-source model w/ different lambda (priors are the same as
a two-source)
- [] parameters for priors for a two-source model w/ different lambda (priors are the same as a two-source)
- [] a two-source carbon mixing model
- [] priors and parameters for priors
- [] a two-source model with different lambdas and alpha corrected using Heuvel et al. 2024.
- [] priors
- [] parameters for priors
- [] vignettes for one source
- [] vignettes for two source
- [] vignettes for twp source ar
11-Feb-2025
- [x] a one-source model
- [x] priors for a one-source model
- [x] parameters for priors for a one-source model
- [] a two-source model without different lambda
- [] priors for a two-source model without different lambda
- [] parameters for priors for a two-source model without different lambda
- [] a two-source model with different lambda
- [] priors for two-source model w/ different lambda (priors are the same as
a two-source)
- [] parameters for priors for a two-source model w/ different lambda (priors are the same as a two-source)
- [] a two-source carbon mixing model
- [] priors and parameters for priors
- [] a two-source model with different lambdas and alpha corrected using Heuvel et al. 2024.
- [] priors
- [] parameters for priors
- [] vignettes for one source
- [] vignettes for two source
- [] vignettes for twp source at
From NEWS.md in the release
Install
Health
ERRORre-building of vignette outputsr-devel-windows-x86_64, r-oldrel-windows-x86_64, r-release-windows-x86_64
r-devel-windows-x86_64
Error(s) in re-building vignettes:
--- re-building 'trps.Rmd' using rmarkdown
specified C++17
make cmd is
make -f "D:/RCompile/recent/R/etc/x64/Makeconf" -f "D:/RCompile/recent/R/share/make/winshlib.mk" CXX='$(CXX17) $(CXX17STD)' CXXFLAGS='$(CXX17FLAGS)' CXXPICFLAGS='$(CXX17PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX17LDFLAGS)' SHLIB_LD='$(SHLIB_CXX17LD)' SHLIB="file295607fe056bf.dll" WIN=64 TCLBIN= OBJECTS="file295607fe056bf.o"
make would use
if test "zfile295607fe056bf.o" != "z"; then \
if test -e "file295607fe056bf-win.def"; then \
echo g++ -shared -s -static-libgcc -o file295607fe056bf.dll file295607fe056bf-win.def file295607fe056bf.o "D:/RCompile/CRANpkg/lib/4.7/rstan/lib/x64/libStanServices.a" -L"D:/RCompile/CRANpkg/lib/4.7/StanHeaders/libs/x64" -lStanHeaders -L"D:/RCompile/CRANpkg/lib/4.7/RcppParallel/lib/x64" -ltbb -LD:/RCompile/CRANpkg/lib/4.7/RcppParallel/libs/x64 -lRcppParallel -LD:/RCompile/CRANpkg/lib/4.7/RcppParallel/lib/x64 -ltbb -ltbbmalloc -L"d:/rtools45/x86_64-
...[truncated]...
(expr, envir, ...)
6. └─brms (local) .fun(...)
7. └─brms (local) .compile_model(model, ...)
8. ├─brms:::eval_silent(...)
9. │ └─base::eval(expr, envir)
10. │ └─base::eval(expr, envir)
11. └─brms::do_call(rstan::stan_model, args)
12. └─brms:::eval2(call, envir = args, enclos = envir)
13. └─base::eval(expr, envir, ...)
14. └─base::eval(expr, envir, ...)
15. └─rstan (local) .fun(model_code = .x1)
16. └─rstan:::cxxfunctionplus(...)
17. └─base::sink(type = "output")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'trps.Rmd' failed with diagnostics:
invalid connection
--- failed re-building 'trps.Rmd'
SUMMARY: processing the following file failed:
'trps.Rmd'
Error: Vignette re-building failed.
Execution haltedr-oldrel-windows-x86_64
Error(s) in re-building vignettes:
--- re-building 'trps.Rmd' using rmarkdown
make cmd is
make -f "D:/RCompile/recent/R-4.5.3/etc/x64/Makeconf" -f "D:/RCompile/recent/R-4.5.3/share/make/winshlib.mk" CXX='$(CXX17) $(CXX17STD)' CXXFLAGS='$(CXX17FLAGS)' CXXPICFLAGS='$(CXX17PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX17LDFLAGS)' SHLIB_LD='$(SHLIB_CXX17LD)' SHLIB="file563f4267d5d6.dll" WIN=64 TCLBIN= OBJECTS="file563f4267d5d6.o"
make would use
if test "zfile563f4267d5d6.o" != "z"; then \
if test -e "file563f4267d5d6-win.def"; then \
echo g++ -shared -s -static-libgcc -o file563f4267d5d6.dll file563f4267d5d6-win.def file563f4267d5d6.o "D:/RCompile/CRANpkg/lib/4.5/rstan/lib/x64/libStanServices.a" -L"D:/RCompile/CRANpkg/lib/4.5/StanHeaders/libs/x64" -lStanHeaders -L"D:/RCompile/CRANpkg/lib/4.5/RcppParallel/lib/x64" -ltbb -LD:/RCompile/CRANpkg/lib/4.5/RcppParallel/libs/x64 -lRcppParallel -LD:/RCompile/CRANpkg/lib/4.5/RcppParallel/lib/x64 -ltbb -ltbbmalloc -L"d:/rtools45/x86_64-w64-mingw32.s
...[truncated]...
(expr, envir, ...)
6. └─brms (local) .fun(...)
7. └─brms (local) .compile_model(model, ...)
8. ├─brms:::eval_silent(...)
9. │ └─base::eval(expr, envir)
10. │ └─base::eval(expr, envir)
11. └─brms::do_call(rstan::stan_model, args)
12. └─brms:::eval2(call, envir = args, enclos = envir)
13. └─base::eval(expr, envir, ...)
14. └─base::eval(expr, envir, ...)
15. └─rstan (local) .fun(model_code = .x1)
16. └─rstan:::cxxfunctionplus(...)
17. └─base::sink(type = "output")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'trps.Rmd' failed with diagnostics:
invalid connection
--- failed re-building 'trps.Rmd'
SUMMARY: processing the following file failed:
'trps.Rmd'
Error: Vignette re-building failed.
Execution haltedr-release-windows-x86_64
Error(s) in re-building vignettes:
--- re-building 'trps.Rmd' using rmarkdown
specified C++17
make cmd is
make -f "D:/RCompile/recent/R-4.6.1/etc/x64/Makeconf" -f "D:/RCompile/recent/R-4.6.1/share/make/winshlib.mk" CXX='$(CXX17) $(CXX17STD)' CXXFLAGS='$(CXX17FLAGS)' CXXPICFLAGS='$(CXX17PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX17LDFLAGS)' SHLIB_LD='$(SHLIB_CXX17LD)' SHLIB="file1a36046f48e0.dll" WIN=64 TCLBIN= OBJECTS="file1a36046f48e0.o"
make would use
if test "zfile1a36046f48e0.o" != "z"; then \
if test -e "file1a36046f48e0-win.def"; then \
echo g++ -shared -s -static-libgcc -o file1a36046f48e0.dll file1a36046f48e0-win.def file1a36046f48e0.o "D:/RCompile/CRANpkg/lib/4.6/rstan/lib/x64/libStanServices.a" -L"D:/RCompile/CRANpkg/lib/4.6/StanHeaders/libs/x64" -lStanHeaders -L"D:/RCompile/CRANpkg/lib/4.6/RcppParallel/lib/x64" -ltbb -LD:/RCompile/CRANpkg/lib/4.6/RcppParallel/libs/x64 -lRcppParallel -LD:/RCompile/CRANpkg/lib/4.6/RcppParallel/lib/x64 -ltbb -ltbbmalloc -L"d:/rtools45/x8
...[truncated]...
(expr, envir, ...)
6. └─brms (local) .fun(...)
7. └─brms (local) .compile_model(model, ...)
8. ├─brms:::eval_silent(...)
9. │ └─base::eval(expr, envir)
10. │ └─base::eval(expr, envir)
11. └─brms::do_call(rstan::stan_model, args)
12. └─brms:::eval2(call, envir = args, enclos = envir)
13. └─base::eval(expr, envir, ...)
14. └─base::eval(expr, envir, ...)
15. └─rstan (local) .fun(model_code = .x1)
16. └─rstan:::cxxfunctionplus(...)
17. └─base::sink(type = "output")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'trps.Rmd' failed with diagnostics:
invalid connection
--- failed re-building 'trps.Rmd'
SUMMARY: processing the following file failed:
'trps.Rmd'
Error: Vignette re-building failed.
Execution halted- ERROR10 OK, 3 ERRORNow
- ERROR12 OK, 1 ERROR2026-09-04
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
Show 4 earlier changesHide 4 earlier changes
- NOTE12 OK, 1 NOTE2026-06-07
- OK14 OK2026-04-22
- ERROR13 OK, 1 ERROR2026-04-18
- OK14 OK2026-03-10
Documentation
- Help pages
- 18 (1 internal)includes a package overview page
- Examples that run
- 100%13 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- not measured
- Median days to close, 50 most recently updated closed PRs
- 2
Releases over time
Issues over time
PRs over time
11 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/benjaminhlina/trps on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2025-12-17 · The repository has a site deploy workflow
pkgdown site last built 2025-12-17
Show all practicesHide 1 practice
Dependencies
Code & Tests
Datasets
People & History
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 0.1.0Latest2025-03-21 · current release
- RR 4.4.0 released · 2024-04-24
Package metadata
- First published
- 2025-03-21
- Total releases
- 1 / 1 yrs
- License
- CC0
- Minimum R
- ≥ 4.1.0
- Bundled data
- 5.6 KB / 4 files
- Download size
- 723 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("trps")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.1890/0012-9658(2002)083[0703:usitet]2.0.co;2, 10.1890/0012-9658(2002)083[2152:faioba]2.0.co;2, 10.1139/cjfas-2024-0028.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.