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
- Open a terminal and clone the repository
git clone https://github.com/quantitative-ecologist/predator-expertise.git
- Install
renvglobally
install.packages("renv")
- In the root folder of the
predator-expertiseproject, openRand install the project libraries from therenv.lockfile 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.
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-expertiseproject - 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.
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 :
- Run models --> Not needed, see 'Reproducibility' section above
- Model validation
- Model processing
- Produce figures
You will find the specific outputs generated by the R scripts in the outputs folder.
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
asymmodels 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.Rmodel 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.).