hier_add: Add nodes to an existing hierarchy

View source: R/hier_add.R

hier_addR Documentation

Add nodes to an existing hierarchy

Description

This function allows to add nodes (levels) to an existing nested hierarchy.

Usage

hier_add(tree, root, nodes)

Arguments

tree

a (nested) hierarchy created using hier_create() or modified using hier_add(), hier_delete() or hier_rename().

root

(character) a name of an existing node in the hierarchy

nodes

(character) names of new nodes that should be added below "root"

Examples

h <- hier_create(root = "Total",  nodes = LETTERS[1:3])
h <- hier_add(h, root = "A", nodes = c("a1", "a5"))
hier_display(h)

sdcHierarchies documentation built on May 29, 2024, 8:01 a.m.