Learn R Programming

EcoDiet

Description

The EcoDiet package estimates a probabilistic topology matrix (all trophic link probabilities) and a diet matrix (all diet proportions) for food webs by combining biotracer and stomach content analyses in a Bayesian hierarchical model.

The full model and its application to a real dataset are described in Hernvann et al. (in press). When using EcoDiet, please cite both Hernvann et al. and the package (citation("EcoDiet")):

To access the citation and DOI of the latest development version, check the Zenodo repository

Using EcoDiet

R installation

EcoDiet is a R package so, first and foremost, you should download and install/update R.

JAGS installation

EcoDiet relies on the JAGS software, so you also need to download and install/update JAGS. You should install the last version of JAGS so that your model will run at maximal speed.

For Windows users

Download JAGS from here, then follow the indications.

For MacOS and Linux users

Try this command if you are on MacOS:

sudo brew update
sudo brew install jags

or this command if you are on Linux:

sudo apt-get update
sudo apt-get install jags

If you get an error message during installation, check this post from Yu-Sung Su's blog.

EcoDiet installation

To download the EcoDiet package from GitHub, you need to use the install_github function from the devtools package to load it. First, install the devtools package:

install.packages("devtools")

Once devtools has been installed, you can load the EcoDiet package:

devtools::install_github("pyhernvann/EcoDiet", build_vignettes = TRUE, dependencies = TRUE)

Since the 6th of May 2020 EcoDiet is also available on the CRAN. You can directly install it from R and load it:

install.packages("EcoDiet")

library("EcoDiet")

Learn how to use EcoDiet

Several vignettes explain how to use the package. Run the following in R and click on the HTML button next to "1. Introduction - How to use EcoDiet":

browseVignettes("EcoDiet")

Or use this if the former does not work:

vignette("introduction_EcoDiet")

Copy Link

Version

Install

install.packages('EcoDiet')

Monthly Downloads

237

Version

2.0.1

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Pierre-Yves Hernvann

Last Published

March 25th, 2024

Functions in EcoDiet (2.0.1)

realistic_literature_diets

Realistic literature diets
plot_results

Plot the posterior means or probability distribution(s)
EcoDiet-package

EcoDiet: Estimating a Diet Matrix from Biotracer and Stomach Content Data
example_stomach_data

Example stomach data
example_biotracer_data

Example biotracer data
diagnose_model

Diagnose EcoDiet model
preprocess_data

Check and preprocess the data
example_literature_diets

Example literature diets
plot_data

Plot the input data
write_model

Write the EcoDiet model in BUGS
realistic_stomach_data

Realistic stomach data
run_model

Run the EcoDiet model
plot_prior

Plot the prior means or probability distribution(s)
realistic_biotracer_data

Realistic biotracer data
mcmc_output_example

The MCMC output for running the example dataset