create_rank_combine {vivainsights} | R 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 |
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
pq_data_small <- dplyr::slice_sample(pq_data, prop = 0.1)
create_rank_combine(
data = pq_data_small,
metric = "Email_hours",
hrvar = c("Organization", "FunctionType", "LevelDesignation")
)