extinctSequences: Generates random sequences of forced extinctions

Description Usage Arguments Value Author(s) Examples

View source: R/extinctSequences.r

Description

Generates random sequences of forced extinctions. The likelihood of extinction for a particular species is controlled by a numeric vector of probabilities.

Usage

1

Arguments

p

Named numeric vector of extinction probabilities. Names represent species. The values should be in range 0, 1 but the do not have to sum up to 1 (see notes on the prob argument of function sample).

r

The number of sequences to be generated. Should be 1 at least.

Value

A matrix with r columns and length(p) rows filled with species names sampled from the names(p). Each column represents an individual orderer extinction sequence. Species with larger values of p are likely to occur at an earlier position in the sequence, i.e. closer to the top of the matrix.

Author(s)

David Kneis david.kneis@tu-dresden.de

Examples

1
2
3
# Basic example
p <- c("top"= 0.9, "fish1"= 0.8, "fish2"= 0.7, "zoopl"= 0.5, "algae"= 0.1)
print(extinctSequences(p, r=5))

dkneis/knut documentation built on Jan. 7, 2020, 4:27 a.m.