hier_to_tree: Convert a nested hierarchy into the default format

View source: R/hier_to_tree.R

hier_to_treeR Documentation

Convert a nested hierarchy into the default format

Description

This function returns a tree in default format (as for example created using hier_create()) for objects created using hier_convert().

Usage

hier_to_tree(inp)

Arguments

inp

a nested tree object created using hier_create() or an object converted with hier_convert()

Value

a nested hierarchy with default format

Examples

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

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