propagate_hierarchy_value: Adds an aggregate value to the vertices of a company...

View source: R/company_hierarchy.R

propagate_hierarchy_valueR Documentation

Adds an aggregate value to the vertices of a company hierarchy, in which you can vary it's direction and distance

Description

Adds an aggregate value to the vertices of a company hierarchy, in which you can vary it's direction and distance

Usage

propagate_hierarchy_value(graph, name_attribute, name_propagate,
  distance = 1, direction = "in", FUN, ...)

Arguments

graph

A graph

name_attribute

The name of the value attribute to be aggregated

name_propagate

The name of the attribute where the aggregated value is stored

distance

The number of 'hops' in the company network that should be included, default = 1

direction

The direction to calculate the propagated value from (can be "in", "out", "all")

FUN

the function which is used to calculate aggregated

...

The parameters passed to the function specified in FUN

Value

A graph where all the nodes contain aggregated value

Examples

graph <- propagate_hierarchy_value(graph, name_attribute = "qty_employees", name_propagate = "qty_employees_cum", distance = 1, direction = "in", FUN = sum, na.rm = TRUE)

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