Learn R Programming

phytools (version 0.2-40)

pbtree: Simulate pure-birth stochastic tree or trees

Description

This function simulates stochastic pure-birth (Yule) trees. Note that if ape=FALSE, then the function will run faster, and the tree is theoretically compatible with the ape "phylo" standard; however some downstream errors with functions such as bind.tree have been observed.

Usage

pbtree(b=1, n=NULL, t=NULL, scale=NULL, nsim=1, ape=TRUE)

Arguments

b
birth rate or speciation rate.
n
desired number of species.
t
time stopping criterion (not yet implemented).
scale
if set, rescales tree to have total length scale.
nsim
number of simulated trees to return.
ape
return nodes in a 'ape' compatible ordering.

Value

  • a tree or list of trees.

Examples

Run this code
# simulate a pure-birth tree with 1000 tips, scaled to a length of 1.0
	tree<-pbtree(n=1000,scale=1)

Run the code above in your browser using DataLab