This function scans a standard query output for weeks where collaboration hours is far outside the mean. Returns a list of weeks that appear to be holiday weeks and optionally an edited dataframe with outliers removed. By default, missing values are excluded.
As best practice, run this function prior to any analysis to remove atypical collaboration weeks from your dataset.
identify_holidayweeks(data, sd = 1, return = "message")
A Standard Person Query dataset in the form of a data frame.
The standard deviation below the mean for collaboration hours that should define an outlier week. Enter a positive number. Default is 1 standard deviation.
String specifying what to return. This must be one of the following strings:
"message"
(default)
"data"
"data_cleaned"
"data_dirty"
"plot"
See Value
for more information.
A different output is returned depending on the value passed to the return
argument:
"message"
: message on console. a message is printed identifying holiday
weeks.
"data"
: data frame. A dataset with outlier weeks flagged in a new
column is returned as a dataframe.
"data_cleaned"
: data frame. A dataset with outlier weeks removed is
returned.
"data_dirty"
: data frame. A dataset with only outlier weeks is
returned.
"plot"
: ggplot object. A line plot of Collaboration Hours with holiday
weeks highlighted.
The metric Collaboration_hours
is used in the calculations. Please ensure
that your query contains a metric with the exact same name.
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_inactiveweeks()
,
identify_nkw()
,
identify_outlier()
,
identify_privacythreshold()
,
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 message by default
identify_holidayweeks(sq_data)
#> The weeks where collaboration was 1 standard deviations below the mean (19.9) are:
#> `2019-12-01`
# Return plot
identify_holidayweeks(sq_data, return = "plot")