RootNode()
identifies the root node of a (rooted or unrooted) phylogenetic
tree.
Unrooted trees are represented internally by a rooted tree with a polytomy
at the root.
Value
RootNode()
returns an integer denoting the root node for each tree.
Badly conformed trees trigger an error.
See also
Test whether a tree is rooted: TreeIsRooted()
Other tree navigation:
AncestorEdge()
,
CladeSizes()
,
DescendantEdges()
,
EdgeAncestry()
,
EdgeDistances()
,
ListAncestors()
,
MRCA()
,
MatchEdges()
,
NDescendants()
,
NodeDepth()
,
NodeNumbers()
,
NodeOrder()
Examples
RootNode(BalancedTree(8))
#> [1] 9
RootNode(UnrootTree(BalancedTree(8)))
#> [1] 9