hier_convert | R Documentation |
This functions allows to convert nested hierarchies into other data structures.
hier_convert(tree, as = "df")
tree |
a (nested) hierarchy created using |
as |
(character) specifying the export format. Possible choices are:
|
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)
# required code to build the hierarchy
hier_convert(h, as = "code")
# data.frame
hier_convert(h, as = "df")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.