label: Labels of nodes and trees

Description Usage Arguments Examples

Description

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

Usage

1
2
3
4
5
6
label(.node)

label(x) <- value

## S3 method for class '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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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)

paulponcet/oak documentation built on May 14, 2019, 7:21 p.m.