Removes all intermediate fossils from a combined tree and labels the first and last fossils of each lineage. Can be used with sampled or complete trees. If only one fossil is present for a particular species it is labelled as first.
Removes all intermediate fossils from a combined tree and labels the first and last fossils of each lineage. Can be used with sampled or complete trees. If only one fossil is present for a particular species it is labelled as first.
prune.fossils(tree)
Arguments
tree: Combined tree with fossils.
Returns
Tree with pruned fossils.
Examples
# simulate treet = ape::rtree(6)# simulate fossilsf = sim.fossils.poisson(rate =2, tree = t)# transform formatt2 = SAtree.from.fossils(t,f)$tree
# prune fossilst4 = prune.fossils(t2)# or transform to sampled tree firstt3 = sampled.tree.from.combined(t2)t4 = prune.fossils(t3)plot(t4)