Add new food-habits data pipeline in data-raw/food-habits (ingestion, estimators, exports)#97
Merged
EOGrady21 merged 16 commits intoMarEcosystemApproaches:mainfrom Apr 8, 2026
Merged
Conversation
Collaborator
|
@david-beauchesne Conflicts should be resolved on inSileco:main, I don't anticipate they are anything major but I Cannot see the details unfortunately |
Contributor
|
@EOGrady21 conflicts should be resolved now. Let me know if you need something else. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a new implementation for food-habits data products in
data-raw/food-habits/.The implementation is intentionally isolated to
data-raw/food-habits/and does not modify existing package runtime code.What was implemented
1) Processing workflow
Updated
data-raw/food-habits/food-habits.Ras the orchestration script.It handles input loading, standardization, filtering/grouping configuration, estimation workflows, and export/save of outputs.
2) Utilities and shared helpers
Added
data-raw/food-habits/food-habits-utils.Rwith:3) Mean-diet estimator
Added
data-raw/food-habits/food-habits-estimate-mean-diet.Rwith:4) Dominant prey summaries
Added
data-raw/food-habits/food-habits-estimate-dominant-prey.R:estimate_mean_diet()5) Predator contribution summaries
Added
data-raw/food-habits/food-habits-estimate-predator-contribution.R:Outputs produced by workflow
The pipeline produces:
food_habits_fullfood_habits_stomachfood_habits_speciesfood_habits_mean_diet_stratifiedfood_habits_dominant_prey_timeseriesfood_habits_prey_predationOutputs are saved in
data-raw/food-habits/*.rdaand exported withusethis::use_data(...).Examples and figures
If
run_examples <- TRUEin the processing script, figures are automatically exported.