roll_up_hierarchy_by_level: Roll up economic activity hierarchy to a certain level in the...

View source: R/economic_activity_hierachy.R

roll_up_hierarchy_by_levelR Documentation

Roll up economic activity hierarchy to a certain level in the tree

Description

This function can be used to aggregate a NACE or SBI code economic activity tree, so the codes represent enough of something for example number of companies, number of customers or revenue.

Usage

roll_up_hierarchy_by_level(graph_tree, level_to, name_attribute)

Arguments

graph_tree

Graph representing the economic activity hierarchy

level_to

The level to which you want to move the nodes in the hierarchy

name_attribute

The name of the attribute you want to check for values

Value

A data frame containing the original economic activity code, the new activity code and the quantity/value that the new code would contain if aggregated

Examples

graph_SBI_rolled <- roll_up_hierarchy_by_level(graph_tree = graph_SBI,
                                               level_to = 2
                                               name_attribute = "qty_companies")

mark-me/graydon.package documentation built on Nov. 14, 2023, 5:31 p.m.