roll_up_hierarchy_by_minimum: Roll up economic activity hierarchy so that the codes hold a...

View source: R/economic_activity_hierachy.R

roll_up_hierarchy_by_minimumR Documentation

Roll up economic activity hierarchy so that the codes hold a minimum value

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_minimum(graph_tree, name_attribute, name_propagated,
  threshold)

Arguments

graph_tree

Graph representing the economic activity hierarchy

name_attribute

The name of the attribute you want to base the roll-up on

name_propagated

The name of the new attribute that should contain the cumulative value of name_attribute

threshold

The minimum value name_attribute should have to be exluded from further roll-up

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

roll_up_hierarchy_by_minimum(graph_tree = graph_SBI, name_attribute = "qty_companies", name_propagated = "qty_companies_cum", threshold = 5000)

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