Learn R Programming

geiger (version 1.2-13)

birthdeath.tree: Birth-death tree simulator

Description

Simulates phylogenetic trees under a uniform birth-death process.

Usage

birthdeath.tree(b, d, time.stop = 0, taxa.stop = 0, seed = 0, print.seed=FALSE, return.all.extinct=TRUE)

Arguments

b
Per-lineage birth (speciation) rate
d
Per-lineage death (extinction) rate
time.stop
Stopping time
taxa.stop
Maximum number of taxa
seed
Random number seed; if seed=0 (default) then random number generator is seeded based on the clock
print.seed
If T, prints out the random number seed associated with each tree
return.all.extinct
Return trees where all lineages have gone extinct? Otherwise, the function will build trees until it gets one with at least one surviving lineage.

Value

  • Phylogenetic tree in ape format. If death rate is non-zero, then the returned tree will likely include some extinct lineages (terminating before the present day). The GEIGER function prune.extinct.taxa can remove these lineages.

Details

Starting from a root node - i.e., two living lineages - this function simulates the growth of a phylogenetic tree under a uniform, time-homogeneous birth-death process. This means that every lineage has a constant probability of speciating, and a constant probability of going extinct, per unit time. If birth is greater than death, then the number of lineages is expected to grow exponentially.

References

Geiger

See Also

BDsim for non-phylogenetic simulations; prune.extinct.taxa

Examples

Run this code
# Pure-birth tree
p1<-birthdeath.tree(b=0.1, d=0, time.stop=20)
plot(p1)

# Birth-death tree with extinct taxa
# The return.all.extinct flag prevents trees with no survivors

p2<-birthdeath.tree(b=0.2, d=0.05, time.stop=20, return.all.extinct=FALSE)
plot(p2)

# Previous tree with extinct taxa removed
prune.extinct.taxa(p2)->p3

Run the code above in your browser using DataLab