This function creates a nested sdc hierarchy from various input structures.
hier_import(inp, from = "json", root = NULL)
inp | an object that should be imported. Argument |
---|---|
from | (character) from which format should be imported. Possible choices are:
|
root | optional name of overall total |
a (nested) hierarchy
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)#> Total #> ├─A #> │ ├─a1 #> │ └─a2 #> └─B #> ├─b1 #> │ └─b1a #> └─b2#> Total #> ├─A #> │ ├─a1 #> │ └─a2 #> └─B #> ├─b1 #> │ └─b1a #> └─b2#> Total #> ├─A #> │ ├─a1 #> │ └─a2 #> └─B #> ├─b1 #> │ └─b1a #> └─b2