hierarchyLong: hierarchyLong

Description Usage Arguments Value Examples

View source: R/hierarchyLong.R

Description

This function transforms a standard set of employee and supervisor identifiers into a long format representing full hierarchies. This is especially useful for narrowing in on a subset of the workforce that reports up to a single person. The function returns a long data frame consisting of one row per employee for every supervisor above them, up to the CEO. The levels represent the number of supervisors from the employee (starting with "1" for an employee's direct supervisor).

Usage

1
hierarchyLong(ee, supv)

Arguments

ee

A list of values representing employees (e.g. employee IDs).

supv

A list of values representing the supervisors of the employees. These values should be of the same data type as the employee values.

Value

data frame

Examples

1
2
3
ee = c("Dale","Bob","Jill","Mark","Julie","Andrea","Susan")
supv = c("Julie","Julie","Julie","Andrea","Susan","Susan","George")
hierarchyLong(ee,supv)

dalekube/hR documentation built on Dec. 22, 2018, 11:04 a.m.