R/identify_privacythreshold.R
identify_privacythreshold.Rd
This function scans a standard query output for groups with of employees under the privacy threshold. The method consists in reviewing each individual HR attribute, and count the distinct people within each group.
identify_privacythreshold(
data,
hrvar = extract_hr(data),
mingroup = 5,
return = "table"
)
A Standard Person Query dataset in the form of a data frame.
A list of HR Variables to consider in the scan. Defaults to all HR attributes identified.
Numeric value setting the privacy threshold / minimum group size. Defaults to 5.
String specifying what to return. This must be one of the following strings:
"table"
"text"
See Value
for more information.
A different output is returned depending on the value passed to the return
argument:
"table"
: data frame. A summary table of groups that fall below the
privacy threshold.
"text"
: string. A diagnostic message.
Returns a ggplot object by default, where 'plot' is passed in return
.
When 'table' is passed, a summary table is returned as a data frame.
Other Data Validation:
check_query()
,
extract_hr()
,
flag_ch_ratio()
,
flag_em_ratio()
,
flag_extreme()
,
flag_outlooktime()
,
hr_trend()
,
hrvar_count_all()
,
hrvar_count()
,
hrvar_trend()
,
identify_churn()
,
identify_holidayweeks()
,
identify_inactiveweeks()
,
identify_nkw()
,
identify_outlier()
,
identify_query()
,
identify_shifts_wp()
,
identify_shifts()
,
identify_tenure()
,
remove_outliers()
,
standardise_pq()
,
subject_validate_report()
,
subject_validate()
,
track_HR_change()
,
validation_report()
# Return a summary table
dv_data %>% identify_privacythreshold(return = "table")
#> # A tibble: 29 × 3
#> hrvar group n
#> <chr> <chr> <int>
#> 1 Organization IT-East 1
#> 2 Organization Financial Planning 2
#> 3 FunctionType IT 3
#> 4 Organization Human Resources 3
#> 5 Organization G&A Central 3
#> 6 Organization Inventory Management 4
#> 7 Organization Finance-South 4
#> 8 Organization Finance-Corporate 4
#> 9 FunctionType Sales 5
#> 10 LevelDesignation Director 5
#> # … with 19 more rows
# Return a diagnostic message
dv_data %>% identify_privacythreshold(return = "text")
#> [1] "[Warning] There are 8 groups under the minimum group size privacy threshold of 5."