RootNode: Which node is a tree's root?

View source: R/tree_properties.R

RootNodeR Documentation

Which node is a tree's root?

Description

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.

Usage

RootNode(x)

Arguments

x

A tree of class phylo, or its edge matrix; or a list or multiPhylo object containing multiple trees.

Value

RootNode() returns an integer denoting the root node for each tree. Badly conformed trees trigger an error.

Author(s)

Martin R. Smith (martin.smith@durham.ac.uk)

See Also

Test whether a tree is rooted: TreeIsRooted()

phangorn::getRoot()

Other tree navigation: AncestorEdge(), CladeSizes(), DescendantEdges(), EdgeAncestry(), EdgeDistances(), ListAncestors(), MRCA(), MatchEdges(), NDescendants(), NodeDepth(), NodeNumbers(), NodeOrder()

Examples

RootNode(BalancedTree(8))
RootNode(UnrootTree(BalancedTree(8)))



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