Package 'hR'

Title: Better Data Engineering in Human Resources
Description: Methods for data engineering in the human resources (HR) corporate domain. Designed for HR analytics practitioners and workforce-oriented data sets.
Authors: Dale Kube [aut, cre]
Maintainer: Dale Kube <[email protected]>
License: GPL
Version: 0.3.0
Built: 2025-03-16 15:14:40 UTC
Source: https://github.com/dalekube/hr

Help Index


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("[email protected]","[email protected]","[email protected]","[email protected]")
supv = c("[email protected]","[email protected]","[email protected]","[email protected]")
hierarchy(ee,supv,format="long",descending=TRUE)

hierarchyStats

Description

The hierarchyStats function computes summary statistics and span of control metrics from a standard set of unique employee and supervisor identifiers (employee IDs, email addresses, etc.).

Usage

hierarchyStats(ee, supv)

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.

Value

list

Examples

ee = c("[email protected]","[email protected]","[email protected]","[email protected]")
supv = c("[email protected]","[email protected]","[email protected]","[email protected]")
hierarchyStats(ee,supv)

hierarchyValid

Description

The hierarchyValid function considers a standard set of unique employee and supervisor identifiers (employee IDs, email addresses, etc.) and validates the completeness and quality of the two input vectors representing the overall hierarchy.

Usage

hierarchyValid(ee, supv)

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.

Value

logical

Examples

ee = c("[email protected]","[email protected]","[email protected]","[email protected]")
supv = c("[email protected]","[email protected]","[email protected]","[email protected]")
hierarchyValid(ee,supv)

Workforce history data for a sample team of employees and contractors.

Description

Artificial data that reflects the workforce history data structure often used to manage employment records in a human capital management system (HCM). Modern enterprises store data in this format at the core of their HCM. This data is the root source of all data analysis and reporting related to headcount, hiring, turnover, etc.

Usage

data(workforceHistory)

Format

A data table with 45 rows and 10 variables:

DATE

Effective date of the record

SEQ

Effective sequence of the record (used to manage multiple records for the same effective date)

ACTION

Action

EMPLID

Employee ID

SUPVID

Supervisor ID

TYPE

Employee type (employee or contractor)

REGTEMP

Regular, temporary, or contract employment

TITLE

Job title

STATUS

Employment status

NAME

Employee name

...