Ancestral edge
Value
AncestorEdge returns a logical vector identifying whether each edge
is the immediate ancestor of the given edge.
See also
Other tree navigation:
CladeSizes(),
DescendantEdges(),
EdgeAncestry(),
EdgeDistances(),
ListAncestors(),
MRCA(),
MatchEdges(),
NDescendants(),
NodeDepth(),
NodeNumbers(),
NodeOrder(),
RootNode()
Examples
tree <- BalancedTree(6)
parent <- tree$edge[, 1]
child <- tree$edge[, 2]
plot(tree)
ape::edgelabels()
AncestorEdge(5, parent, child)
#> [1] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
which(AncestorEdge(5, parent, child))
#> [1] 1