AllAncestors lists ancestors of each parent node in a tree.
Usage
AllAncestors(parent, child)
Arguments
parent
the first column of the edge matrix of a tree of class
phylo, i.e. tree$edge[, 1].
child
the second column of the edge matrix of a tree of class
phylo, i.e. tree$edge[, 2].
Value
AllAncestors returns a list. Entry i contains a vector containing,
in order, the nodes encountered when traversing the tree from node i to the
root node.
The last entry of each member of the list is therefore the root node,
with the exception of the entry for the root node itself, which is NULL.
Details
Note that the tree's edges must be listed in an order whereby each entry in
tr$edge[, 1] (with the exception of the root) has appeared already in
tr$edge[, 2].