create_niche_model {ATNr}R Documentation

Create a food web based on the niche model

Description

Function to generate a food web based on the niche model (Williams and Martinez, 2000) based on the number of species and connectance. Corrections from Allesina et al. (2008) are used.

Usage

create_niche_model(S, C)

Arguments

S

integer, number of species.

C

numeric, connectance i.e. the number of realized links over the all possible links.

Details

If at least one species has not resource or consumer (i.e. it is an isolated species), another food web is generated, until a maximum of 100 iterations.

Value

A (square) matrix with zeros (no interaction) and ones (species j consume species i).

References

Williams, R. J., & Martinez, N. D. (2000). Simple rules yield complex food webs. Nature, 404(6774), 180-183.

Allesina, S., Alonso, D., & Pascual, M. (2008). A general model for food web structure. science, 320(5876), 658-661.

Examples

set.seed(123)
web_niche <- create_niche_model(30, .1)
image(t(web_niche))

[Package ATNr version 1.1.0 Index]