simPaleoTrees(p, q, r, ntrees = 1, all.extinct = FALSE,
modern.samp.prob = 1, mintime = 1, maxtime = 100, mintaxa = 2,
maxtaxa = 500, anag.rate = 0, prop.bifurc = 0, prop.cryptic = 0,
drop.zlb = TRUE, print.runs = FALSE, plot = FALSE)simFossilTaxa, taxa2phylo and
sampleRanges.
This function will output 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).
simPaleoTrees essentially uses simFossilTaxa with no.cond
as TRUE and other minimal conditioning, so as to get as
unbiased a sample of simulations as possible (without
exceeding the maximum constraints). This is useful for
birth-death analyses, although a number of options
available in simFossilTaxa are thus unavailable in
simPaleoTrees. By default, there is no conditioning on the
number of extant taxa, living taxa are sampled perfectly at
time 0 and zero-length branches are dropped. Unlike
simFossilTaxa, you cannot condition on a certain number of
extant taxa, only whether they are allowed or not (via
all.extinct). As of version 1.6, there are now options
relating to speciation modes. By default, taxa are only
simulated under budding cladogenesis but this can be
changed with the arguments anag.rate, prop.bifurc and
prop.cryptic. Trees with cryptic taxa are always returned
with cryptic taxa unmerged (see sampleRanges).
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 datasets of
paleontological phylogenies, at least in most aspects.
The print.runs argument does not work precisely as in
simFossilTaxa; it only counts how many accepted datasets
from simFossilTaxa are acceptable for output after the
simulation of sampling.simFossilTaxa, taxa2phylo,
sampleRangesset.seed(444)
#simulate trees conditioned to have no living descendants
trees <- simPaleoTrees(p=0.1,q=0.1,r=0.5,ntrees=10,all.extinct=TRUE,maxtime=100,
print.runs=TRUE,plot=TRUE)
#number of tips
sapply(trees,Ntip)
#simulate trees conditioned to have possible living taxa and perfect sampling at modern
trees <- simPaleoTrees(p=0.1,q=0.1,r=0.5,ntrees=10,all.extinct=FALSE,maxtime=100,
modern.samp.prob=TRUE,print.runs=TRUE,plot=TRUE)
#number of tips
sapply(trees,Ntip)Run the code above in your browser using DataLab