Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Online repository for: The role of prey behaviour in predator expertise acquisition: insights from a virtual ecosystem

License

Notifications You must be signed in to change notification settings

quantitative-ecologist/predator-expertise

Repository files navigation

Online repository

Description

Online repository to reproduce the results presented in :

The role of prey behaviour in predator expertise acquisition: insights from a virtual ecosystem. (2026)

Earlier version of this work:

Prey movement shapes the acquisition of predator expertise in a virtual bi-trophic system. (2024). BioRxiv. https://doi.org/10.1101/2024.11.15.621573


Reproducibility

1. Preparing the project

  • Open a terminal and clone the repository
git clone https://github.com/quantitative-ecologist/predator-expertise.git
  • Install renv globally
install.packages("renv")
  • In the root folder of the predator-expertise project, open R and install the project libraries from the renv.lock file to reproduce the environment. This will install the libraries inside the project.
renv::restore()

** Note for Windows users: refrain from putting the project inside OneDrive as it struggles with renv. Just put the project in a place that is not tracked by OneDrive.

2. Download the model outputs

The model fitting cannot be reproduced on your personal computer as it requires important computing resources. The model output files (.rds) are hosted on this OSF repository.

To download the files locally:

  • Open a terminal
  • Go to the root folder of the predator-expertise project
  • Type the following command:
make download-models

If you don't have the make command in your computer, you can also simply run the script from your terminal:

Rscript download_models.R

This will create a subfolder called outputs_models within outputs and download all the model output files (.rds) in it.


General coding workflow

The subfolders in the code folder are ordered to reflect the worflow.

Here are the steps highlighting the process with a link to the code subfolders :

  1. Run models --> Not needed, see 'Reproducibility' section above
  2. Model validation
  3. Model processing
  4. Produce figures

You will find the specific outputs generated by the R scripts in the outputs folder.


Workflow to run the models

This workflow is exclusively for .R files used to compute the Bayesian asym models with the brms package (see the code_models folder).

The fit_LM-PreySpeed.R and fit_GLM-RandomSample models do not require important resources and can be run locally.

Generator Operating system Kernel Programming language Code Results
Digital Research Alliance of Canada / Fir AlmaLinux 9.6 (Sage Margay) Linux 5.14.0-570.22.1.el9_6.x86_64, compiled June 19, 2025 R code_models folder outputs_models folder**

  • I ran all the asym models on Fir, a computer cluster managed by the Digital Research Alliance of Canada.

  • To run the models on a cluster other than Fir, simply use the job (.sh) files and adapt them to your needs. They are in the code_models folders and have the same name as the .R model files.

** Note: the outputs_models folder has to be created manually if you want to compute the models yourself and transfer the files there, otherwise, you won't be able to continue working with the project (i.e., produce figures, tables, etc.).

About

Online repository for: The role of prey behaviour in predator expertise acquisition: insights from a virtual ecosystem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /