Ancestral edge
AncestorEdge(edge, parent, child)
Number of an edge
the first column of the edge matrix of a tree of class phylo, i.e. tree$edge[, 1].
phylo
tree$edge[, 1]
the second column of the edge matrix of a tree of class phylo, i.e. tree$edge[, 2].
tree$edge[, 2]
AncestorEdge returns a logical vector identifying whether each edge is the immediate ancestor of the given edge.
AncestorEdge
Other tree navigation: AllAncestors, DescendantEdges, EdgeAncestry, EdgeDistances, MRCA, NonDuplicateRoot
AllAncestors
DescendantEdges
EdgeAncestry
EdgeDistances
MRCA
NonDuplicateRoot
# NOT RUN { tree <- BalancedTree(6) parent <- tree$edge[, 1] child <- tree$edge[, 2] plot(tree) ape::edgelabels() AncestorEdge(5, parent, child) which(AncestorEdge(5, parent, child)) # }
Run the code above in your browser using DataLab