Learn R Programming

paleotree (version 1.0)

simPaleoTrees: Simulating Un-Conditioned Trees of Fossil Taxa

Description

Creates sets of paleo-trees with minimal conditioning and with sampling, except node-times are known perfectly

Usage

simPaleoTrees(p, q, r, ntrees, nExtant = NULL, maxtime=1000, maxtaxa=3000, modern.samp = T, drop.zlb = T, plot = F)

Arguments

p
Instantaneous rate of speciation per lineage-time units
q
Instantaneous rate of extinction per lineage-time units
r
Instantaneous rate of sampling per lineage-time units
ntrees
Number of trees to simulate
nExtant
Maximum number of extant lineages
maxtime
Maximum time to run simulation
maxtaxa
Maximum number of taxa allowed over entire simulation
modern.samp
Should taxa extant at present be sampled perfectly at the present-day (time=0)?
drop.zlb
Should zero-length branches be dropped?
plot
Should data be plotted as it is simulated?

Value

  • Output is an object of class multiphylo containing the simulated phylogenies.

Details

Essentially a complex wrapper for simFossilTaxa, sampleRanges and taxa2phylo, this function will spit out simulated phylogenies of fossil taxa where the divergence times are perfectly known, only sampled taxa are included on the tree and tips are located at the last observed time for the species (the apparent time of extinction, except for living taxa). The defaults are set such that there is as minimal conditioning as possible, to get as unbiased a sample of simulations as possible. There is no conditioning on the number of extant taxa, living taxa are sampled perfectly at time 0 and zero-length branches are dropped. maxtaxa and maxtime are as high as possible without decreasing performance. Because the divergence times are known perfectly, yet tips are at the apparent time of extinction and unsampled taxa are dropped, one should not use the output of this analysis except for very specialized simulation analyses. The results are probably not anything like real data at least in most qualities.

See Also

simFossilTaxa,taxa2phylo,sampleRanges,

Examples

Run this code
#simulate trees with no living descendants
trees<-simPaleoTrees(p=0.1,q=0.1,r=0.5,ntrees=2,nExtant=0,modern.samp=TRUE,drop.zlb=TRUE,plot=TRUE)
sapply(trees,Ntip)
#simulate trees with living descendants
trees<-simPaleoTrees(p=0.1,q=0.1,r=0.5,ntrees=2,nExtant=10,modern.samp=TRUE,drop.zlb=TRUE,plot=TRUE)
sapply(trees,Ntip)

Run the code above in your browser using DataLab