generate_niche | R Documentation |
This function generates one or multiple food webs using the Niche Model proposed by Williams & Martinez (2000). The model assumes that each species has a niche value and consumes resources within a defined range.
generate_niche(S, C, nsim = 1)
S |
Integer. The number of species in the community. Must be |
C |
Numeric. The connectance (fraction of realized links). Must be |
nsim |
Integer. The number of networks to generate ( |
If nsim = 1
, returns a binary adjacency matrix (S × S
).
If nsim > 1
, returns a list of igraph
objects, each representing a food web.
Williams, R. J., and N. D. Martinez. 2000. Simple rules yield complex food webs. Nature 404:180–183.
generate_niche(20, 0.1) # Single adjacency matrix
generate_niche(20, 0.1, nsim=5) # List of 5 food webs as igraph objects
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.