Description Usage Arguments Value Author(s) Examples
View source: R/extinctSequences.r
Generates random sequences of forced extinctions. The likelihood of extinction for a particular species is controlled by a numeric vector of probabilities.
1 | extinctSequences(p, r)
|
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 |
r |
The number of sequences to be generated. Should be 1 at least. |
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.
David Kneis david.kneis@tu-dresden.de
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.