Skip to contents

Add a node to a tree.

Usage

add_node(x, ...)

Arguments

x

The tree() to add a node() to.

value

Any attributes or information to assign to the node.

name

Optional: a name to assign to the node's index.

parent

The parent node of the new node. Only one parentless node is allowed in a given tree.

Value

A tree() object.

Examples

tree() |> add_node()
#> <dendro::tree>
#>  @ size        : int 1
#>  @ node_indices: int 1
#>  @ next_idx    : int 2
#>  @ root        : int 1
#>  @ nodes       :List of 1
#>  .. $ : <dendro::node>
#>  ..  ..@ index   : int 1
#>  ..  ..@ value   :'data.frame':	0 obs. of  0 variables
#>  ..  ..@ parent  : int NA
#>  ..  ..@ children: int(0)