hier_delete {sdcHierarchies} | R Documentation |
Delete nodes from an existing hierarchy
Description
This function allows to delete nodes (levels) from an existing nested hierarchy.
Usage
hier_delete(tree, nodes)
Arguments
tree |
a (nested) hierarchy created using |
nodes |
character vector of nodes that should be deleted |
Examples
h <- hier_create(root = "Total", nodes = LETTERS[1:2])
h <- hier_add(h, root = "A", nodes = c("a1", "a2"))
h <- hier_add(h, root = "B", nodes = c("b1", "b2"))
h <- hier_add(h, root = "b1", nodes = "b1a")
hier_display(h)
h <- hier_delete(h, nodes = c("a1", "b1a"))
hier_display(h)
[Package sdcHierarchies version 0.21.0 Index]