Learn R Programming

oak (version 0.2.3)

root: Root(s) of a tree

Description

Find the root of a tree (or the multiple roots for a non-rooted tree)

Usage

root(.tree)

# S3 method for rtree root(.tree)

roots(.tree)

# S3 method for rtree roots(.tree)

Arguments

.tree

A tree.

Value

root returns a node, the root of the tree if it exists; if .tree is not rooted, an error is thrown.

roots returns a list of nodes, the roots of the tree.