# simulate tree
t = ape::rtree(6)
# simulate fossils
f = sim.fossils.poisson(rate = 2, tree = t)
# transform format
t2 = SAtree.from.fossils(t,f)$tree
# transform to sampled tree
t3 = sampled.tree.from.combined(t2)
plot(t3)
Run the code above in your browser using DataLab