reconstructed.tree.fossils.objects {FossilSim} | R Documentation |
Returns tree and fossil objects that you can use to plot the reconstructed tree.
Description
Note that for datasets containing extinct only samples (& rho = 0) the ages output are scaled so that the youngest sample = 0.
Usage
reconstructed.tree.fossils.objects(fossils, tree, rho = 1)
Arguments
fossils |
Fossils object. |
tree |
Tree object. |
rho |
Extant species sampling probability. Default = 1, will be disregarded if fossils object already contains extant samples. |
Value
A list containing the tree and fossil objects.
Examples
# simulate tree
birth = 0.1
death = 0.05
tips = 10
t = TreeSim::sim.bd.taxa(tips, 1, birth, death)[[1]]
# simulate fossils
f = sim.fossils.poisson(rate = 0.3, tree = t)
# simulate extant samples
f = sim.extant.samples(f, tree = t, rho = 0.5)
# plot the complete tree
plot(f,t)
# generate tree & fossil objects corresponding to the reconstructed tree
out = reconstructed.tree.fossils.objects(f, t)
f.reconst = out$fossils
t.reconst = out$tree
# plot the reconstructed tree
plot(f.reconst, t.reconst)
[Package FossilSim version 2.3.3 Index]