create_Lmatrix function

Make L matrix

Make L matrix

create_Lmatrix(BM, nb_b, Ropt = 100, gamma = 2, th = 0.01)

Arguments

  • BM: float vector, body mass of species.
  • nb_b: integer, number of basal species.
  • Ropt: numeric, consumer/resource optimal body mass ratio.
  • gamma: numeric, code for the width of the Ricker function.
  • th: float, the threshold below which attack rates are considered = 0.

Returns

A numeric matrix with the probability for an attack event between two species to be successful.

Details

The L matrix contains the probability for an attack event to be successful based on allometric rules and a Ricker function defined by Ropt and gamma. 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.

Examples

set.seed(123) mass <- sort(10 ^ runif(30, 2, 6)) L <- create_Lmatrix(mass, nb_b = 10, Ropt = 100) image(t(L))
  • Maintainer: Benoit Gauzens
  • License: GPL (>= 2)
  • Last published: 2023-09-04

Useful links