AncestorEdge: Ancestral edge

View source: R/tree_ancestors.R

AncestorEdgeR Documentation

Ancestral edge

Description

Ancestral edge

Usage

AncestorEdge(edge, parent, child)

Arguments

edge

Number of an edge

parent

Integer vector corresponding to the first column of the edge matrix of a tree of class phylo, i.e. tree[["edge"]][, 1]

child

Integer vector corresponding to the second column of the edge matrix of a tree of class phylo, i.e. tree[["edge"]][, 2].

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)
which(AncestorEdge(5, parent, child))


TreeTools documentation built on Sept. 11, 2024, 8:27 p.m.