untb (version 1.0-9)

untb: Ecological drift simulation under the Unified Neutral Theory of Biodiversity

Description

Simulates ecological drift under the UNTB. Function untb() carries out the simulation; function display.untb() displays an ongoing simulation using nice colours. Function select() carries out a single generational step.

Usage

untb(n = 100, prob.of.mutate = 0.01,  individually = FALSE, gens = 150, keepall = FALSE,
start.mono = FALSE)
display.untb(n = 400, gens = 9e+05, prob.of.mutate = 0.001, cex=3, individually
= TRUE, start.mono = TRUE, flash = FALSE, t1 = 0, flashsleep = 0.1, ...)
select(a, prob.of.mutate = 0)

Arguments

n
Size of ecosystem
prob.of.mutate
Probability of mutation
individually
Boolean, indicating whether the ecosystem should evolve simultaneously (FALSE), or individually (TRUE)
gens
Number of generations to simulate
cex
In function display.untb(), the size of the dots used for plotting, defaulting to 3
keepall
In function untb() Boolean with default FALSE meaning to return the system at the end of the simulation and TRUE meaning to return a matrix whose rows are the ecosystem at successive times.
start.mono
Boolean, with default FALSE meaning to start the simulation with a system of maximal diversity and TRUE to start with a monoculture
flash
In function display.untb(), Boolean argument with TRUE meaning to indicate the site of a death/birth with a flashing ring; and default FALSE meaning to omit the flashing ring and thus simulate much<
t1
In function display.untb(), time delay between generations
flashsleep
In function display.untb(), time delay of flashing ring
a
Ecosystem start state for use in function select()
...
In function display.untb(), further arguments passed to plot() and points().

Value

  • Function untb() returns the final state of the ecosystem.

References

S. P. Hubbell. The Unified Neutral Theory of Biodiversity. Princeton University Press, 2001.

Examples

Run this code
untb(n=10, prob=0.1, gens=100)

a <- untb(n=10,prob=0.05, gens=1000,keep=TRUE)
plot(species.count(a),type="b")
matplot(species.table(a),type="l",lty=1)

display.untb(prob=0.1, gens=1e2)

Run the code above in your browser using DataLab