View source: R/tree_ancestors.R
AncestorEdge | R Documentation |
Ancestral edge
AncestorEdge(edge, parent, child)
edge |
Number of an edge |
parent |
Integer vector corresponding to the first column of the edge
matrix of a tree of class |
child |
Integer vector corresponding to the second column of the edge
matrix of a tree of class |
AncestorEdge
returns a logical vector identifying whether each edge
is the immediate ancestor of the given edge.
Other tree navigation:
CladeSizes()
,
DescendantEdges()
,
EdgeAncestry()
,
EdgeDistances()
,
ListAncestors()
,
MRCA()
,
MatchEdges()
,
NDescendants()
,
NodeDepth()
,
NodeNumbers()
,
NodeOrder()
,
RootNode()
tree <- BalancedTree(6)
parent <- tree$edge[, 1]
child <- tree$edge[, 2]
plot(tree)
ape::edgelabels()
AncestorEdge(5, parent, child)
which(AncestorEdge(5, parent, child))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.