Modified collapse.singles() from package ape which deletes the single nodes (i.e., with a single descendant) in a tree, respecting the rec function. Internal, used by drop.tip.rec

collapse.singles.useRec(tree, root.edge = FALSE)

Arguments

tree

an object of class "phylo".

root.edge

whether to get the singleton edges from the root until the first bifurcating node and put them as root.edge of the returned tree. By default, this is ignored or if the tree has no edge lengths.

Value

tree with rec data