create_model_Unscaled_nuts | R Documentation |
Initialize an ATN model, following Schneider et al. 2016, Nature Communication
create_model_Unscaled_nuts(nb_s, nb_b, nb_n = 2, BM, fw)
nb_s |
integer, number of total species. |
nb_b |
integer, number of basal species. |
nb_n |
integer, number of nutrients. |
BM |
float vector, body mass of species. |
fw |
binary adjacency matrix of the food web. |
A model is defined by the total number of species (nb_s), the number of basal species (nb_b), the number of nutrients (nb_n), the body masses (BM) of species, and the adjacency matrix (fw) representing species interactions. Nutrients are not counted as species.
An object of class ATN (Rcpp_parameters_prefs).
library(ATNr)
set.seed(123)
n_species <- 50
n_basal <- 20
n_nutrients <- 2
masses <- sort(10^runif(n_species, 2, 6)) #body mass of species
L <- create_Lmatrix(masses, n_basal)
fw <- L
fw[fw > 0] <- 1
mod <- create_model_Unscaled_nuts(n_species, n_basal, n_nutrients, masses, fw)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.