oak (version 0.2.1)

label: Labels of nodes and trees

Description

Get the label of a node or the labels of all nodes of a tree.

Usage

label(.node)

label(x) <- value

# S3 method for rtree labels(object, ...)

Arguments

.node, x

A node.

value

character. New label to be applied to the node.

...

Additional arguments (not used).

.tree, object

A tree.

Examples

Run this code
# NOT RUN {
## Rooted tree
(tr0 = c_("Bob", "Carl", "Daniel"))
(tr1 = c_("Bill", "Caroline", "Dimitri", "Enoc"))
(tr2 = r_("Alice", s = list(tr0, tr1)))
labels(tr0)
labels(tr1)
labels(tr2)

## Unrooted tree
(tr3 = r_(s = list(tr2, c_("Grand-Mother", "Father", "Son"))))
labels(tr3)

# }

Run the code above in your browser using DataLab