Flag unusual high collaboration hours to after-hours collaboration hours ratio
Source:R/flag_ch_ratio.R
flag_ch_ratio.Rd
This function flags persons who have an unusual ratio of collaboration hours to after-hours collaboration hours. Returns a character string by default.
Usage
flag_ch_ratio(data, threshold = c(1, 30), return = "message")
Value
A different output is returned depending on the value passed to the return
argument:
"message"
: message in the console containing diagnostic summary"text"
: string containing diagnostic summary"data"
: data frame. Person-level data with flags on unusually high or low ratios
Metrics used
The metric Collaboration_hours
is used in the calculations. Please ensure
that your query contains a metric with the exact same name.
See also
Other Data Validation:
check_query()
,
extract_hr()
,
flag_em_ratio()
,
flag_extreme()
,
flag_outlooktime()
,
hr_trend()
,
hrvar_count()
,
hrvar_count_all()
,
hrvar_trend()
,
identify_churn()
,
identify_holidayweeks()
,
identify_inactiveweeks()
,
identify_nkw()
,
identify_outlier()
,
identify_privacythreshold()
,
identify_shifts()
,
identify_tenure()
,
track_HR_change()
,
validation_report()
Examples
flag_ch_ratio(pq_data)
#> [Pass] The ratio of after-hours collaboration to total collaboration hours is outside the expected threshold for only 0 employees (0 % of the total).
#> - 0 employees (0 %) have an unusually high after-hours collaboration (relative to weekly collaboration hours)
#> - 0 employees (0 %) have an unusually low after-hours collaboration
data.frame(PersonId = c("Alice", "Bob"),
Collaboration_hours = c(30, 0.5),
After_hours_collaboration_hours = c(0.5, 30)) %>%
flag_ch_ratio()
#> [Warning] The ratio of after-hours collaboration to total collaboration hours is outside the expected threshold for 2 employees (100 % of the total).
#> - 1 employees (50 %) have an unusually high after-hours collaboration (relative to weekly collaboration hours)
#> - 1 employees (50 %) have an unusually low after-hours collaboration