# 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)
Run the code above in your browser using DataLab