knitr::opts_chunk$set(echo = FALSE, cache = TRUE) set.seed(2018-06-05)
The trophic
R package is a set of tools to connect trophic interaction networks with primary production estimates to predict production and biomass at all nodes in a trophic network.
flexible -- run multiple scenarios simultaneously using your choice of parallel architecture
stochastic -- incorporate stochasticity into any model component, with additional modules for sensitivity analysis
The examples has a set of example trophic
analyses. If you'd like to contribute, check out the contributions page.
Here's a simple example with the sample data sets included in trophic
:
# load the package library(trophic) # create a food web object from a pre-defined interaction matrix food_web_object <- build_food_web(interaction_matrix = food_web) # create an efficiency object that captures transfer efficiencies among nodes efficiency_object <- build_efficiency_matrix(efficiency_mean = efficiency_mean, efficiency_sd = 0.01) # create a dominance object that determines the outcomes of competition for resources dominance_object <- build_dominance_matrix(dominance = dominance_matrix) # set some primary production values (inputs to trophic model) primary_producers_example <- build_primary_producers(production_mean = production_mean, production_sd = production_sd) # collate trophic information into a single trophic_dynamics object trophic_dynamics_object <- build_trophic_dynamics(food_web = food_web_object, efficiency_matrix = efficiency_object, dominance_matrix = dominance_object) # Estimate production values from constructed trophic_dynamics object, allowing # stochasticity in the food web and the transfer efficiencies production_estimates <- estimate_production(trophic_dynamics_object, primary_producers_example, stochastic = c("food_web", "efficiency")) # estimate biomass from production using a deterministic or stochastic production- # biomass ratio test_pb_ratio <- build_pb_ratio(range = c(0.25, 5.75), type = "fixed") biomass_estimates <- estimate_biomass(production_estimates, test_pb_ratio)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.