hierarchy: hierarchy

Description Usage Arguments Value Examples

View source: R/hierarchy.R

Description

The hierarchy function transforms a standard set of unique employee and supervisor identifiers (employee IDs, email addresses, etc.) into a wide or elongated format that can be used to aggregate employee data by a particular line of leadership (i.e. include everyone who rolls up to Susan).

Usage

1
hierarchy(ee, supv, format = "long", descending = TRUE)

Arguments

ee

A vector containing unique identifiers for employees.

supv

A vector containing unique identifiers for supervisors. These values should be of the same type as the employee values.

format

character string; either "long" or "wide"; default = "long".

descending

logical; default = TRUE. Should the hierarchy levels be descending (i.e. the top person in the hierarchy is represented at level 1)?

Value

data table

Examples

1
2
3
ee = c("Dale@hR.com","Bob@hR.com","Julie@hR.com","Andrea@hR.com")
supv = c("Julie@hR.com","Julie@hR.com","Andrea@hR.com","Susan@hR.com")
hierarchy(ee,supv,format="long",descending=TRUE)

hR documentation built on Jan. 16, 2021, 5:37 p.m.