Displays an ongoing simulation of neutral ecological drift using nice colours and a simple animation technique. Does not work as intended in RStudio: use base R
display.untb(start, gens=100, prob.of.mutate = 0, cex=3, individually
= TRUE, ask = FALSE, flash = FALSE, delay = 0, cols=NULL, ...)
Starting ecosystem; coerced to class census. Usually,
pass an object of class count; see examples. To start
with a monoculture of size 10, use start=rep(1,10)
and to
start with a system of maximal diversity (ie all singletons), use
start=1:10
Number of generations to simulate
Probability of mutation. The default of zero
corresponds to \(\theta=0\) and this means that any
ecosystem will eventually become a monoculture (it is particularly
instructive to watch this happen, especially with a starting
ecosystem of maximal diversity\(\mbox{---}\)but be warned,
this can take a long time, especially for ecosystems with a large
number of individuals). Nonzero values mean that a nontrivial
dominance-diversity curve will eventuate, although this too can take
a long time to happen. Try a nonzero value of prob.of.mutate
with monoculture start (use individually=FALSE
for such
experiments)
The size of the dots used for plotting, defaulting to 3
Boolean, with default TRUE
meaning
that a timestep means the death of a single individual and the
simultaneous birth of a new individual; and FALSE
meaning
that a timestep refers to every individual in the system
Boolean, with default FALSE
meaning to display the
generations autonomously, and TRUE
meaning to wait for the
user to hit the “return” before proceeding
Boolean, with TRUE
meaning to indicate the site
of a death/birth with a flashing ring; and default FALSE
meaning to omit the flashing ring. Use TRUE
for pedagogic
purposes, possibly with ask
set to TRUE
, or a nonzero
delay
. This option only kicks in if individually
is
TRUE
Time delay between generations in seconds; meaningful
whatever the value of flash
and individually
A vector of colours with default NULL
meaning to
choose them randomly. Useful for printing stills from a
movie
Robin K. S. Hankin
S. P. Hubbell 2001. “The Unified Neutral Theory of Biodiversity”. Princeton University Press.
data(butterflies)
display.untb(start=butterflies,prob=0, gens=1e2)
Run the code above in your browser using DataLab