hier_rename | R Documentation |
This function allows to rename one or more node(s) (levels) in an existing nested hierarchy.
hier_rename(tree, nodes)
tree |
a (nested) hierarchy created using |
nodes |
(character) new names of nodes/levels that should be changed as a named vector: names refer to old, existing names, the values to the new labels |
h <- hier_create(root = "Total", nodes = LETTERS[1:3])
h <- hier_add(h, root = "A", nodes = c("a1", "a5"))
hier_display(h)
h <- hier_rename(h, nodes = c("a1" = "x1", "A" = "X"))
hier_display(h)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.