| reconstructed.tree.fossils.objects | R Documentation |
Note that for datasets containing extinct only samples (& rho = 0) the ages output are scaled so that the youngest sample = 0.
reconstructed.tree.fossils.objects(
fossils,
tree,
rho = 1,
tip_order = c("oldest_first", "youngest_first")
)
fossils |
Fossils object. |
tree |
Tree object. |
rho |
Extant species sampling probability. Default = 1, will be disregarded if fossils object already contains extant samples. |
tip_order |
Order of indexes to assign to the tips in the SA tree, either 'oldest_first' (by default, indexes increase towards the present) or 'youngest_first' (indexes increase towards the past). |
A list containing the reconstructed SA tree and fossil objects.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.