hierarchy {hR} | R Documentation |
hierarchy
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
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
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)
[Package hR version 0.2.50 Index]