create_rollup_tree()
creates a tree suitable for use with rollup()
by applying helper functions to construct vertices and edges.
Examples
get_keys <- function() wbs_table$id
get_parent_key_by_child_key <- function(key) wbs_table[which(wbs_table$id == key), "pid"]
create_rollup_tree(get_keys, get_parent_key_by_child_key)
#> IGRAPH 5056114 DN-- 10 9 --
#> + attr: name (v/c)
#> + edges from 5056114 (vertex names):
#> [1] 1 ->top 2 ->top 3 ->top 1.1->1 1.2->1 2.1->2 2.2->2 3.1->3
#> [9] 3.2->3