Skip to content

Add getTrophicLevel() and getTrophicLevelBySpecies() functions#333

Merged
gustavdelius merged 4 commits intomasterfrom
trophic_level
Apr 10, 2026
Merged

Add getTrophicLevel() and getTrophicLevelBySpecies() functions#333
gustavdelius merged 4 commits intomasterfrom
trophic_level

Conversation

@gustavdelius
Copy link
Copy Markdown
Member

@gustavdelius gustavdelius commented Apr 10, 2026

Summary

  • Adds getTrophicLevel() returning an ArraySpeciesBySize (species × size) with size-resolved trophic levels, accounting for ontogenetic diet shifts by integrating consumption-weighted average prey trophic level over the individual's growth trajectory
  • Adds getTrophicLevelBySpecies() returning consumption-rate-weighted mean trophic level per species
  • Functions are marked as experimental
  • Closes Function to calculate trophic level #307

Test plan

  • devtools::test() passes
  • devtools::check() passes
  • New tests in tests/testthat/test-summary_methods.R cover both functions

…alculate size-resolved and species-averaged trophic levels.
Merge branch 'master' into trophic_level

# Conflicts:
#	pkgdown/_pkgdown.yml
@gustavdelius gustavdelius merged commit a934387 into master Apr 10, 2026
1 check failed
@gustavdelius gustavdelius deleted the trophic_level branch April 10, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Function to calculate trophic level

1 participant