create_rank_combine: Create combination pairs of HR variables and run...

create_rank_combineR Documentation

Create combination pairs of HR variables and run 'create_rank()'

Description

Create pairwise combinations of HR variables and compute an average of a specified advanced insights metric.

Usage

create_rank_combine(data, hrvar = extract_hr(data), metric, mingroup = 5)

Arguments

data

A Standard Person Query dataset in the form of a data frame.

hrvar

String containing the name of the HR Variable by which to split metrics. Defaults to "Organization". To run the analysis on the total instead of splitting by an HR attribute, supply NULL (without quotes).

metric

Character string containing the name of the metric, e.g. "Collaboration_hours"

mingroup

Numeric value setting the privacy threshold / minimum group size. Defaults to 5.

Details

This function is called when the mode argument in create_rank() is specified as "combine".

Value

Data frame containing the following variables:

  • hrvar: placeholder column that denotes the output as "Combined".

  • group: pairwise combinations of HR attributes with the HR attribute in square brackets followed by the value of the HR attribute.

  • Name of the metric (as passed to metric)

  • n

Examples

# Use a small sample for faster runtime
sq_data_small <- dplyr::slice_sample(sq_data, prop = 0.1)

create_rank_combine(
  data = sq_data_small,
  metric = "Email_hours"
)


wpa documentation built on Aug. 21, 2023, 5:11 p.m.