create_rollup_tree {rollupTree}R Documentation

Create a tree for use with rollup()

Description

create_rollup_tree() creates a tree suitable for use with rollup() by applying helper functions to construct vertices and edges.

Usage

create_rollup_tree(get_keys, get_parent_key_by_child_key)

Arguments

get_keys

A function() that returns a collection of names for vertices.

get_parent_key_by_child_key

A function(key) that returns for each child key the key of its parent.

Value

An igraph directed graph with vertices and edges as supplied

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)


[Package rollupTree version 0.3.2 Index]