identify_holidayweeks {vivainsights} | R Documentation |
Identify Holiday Weeks based on outliers
Description
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.
Usage
identify_holidayweeks(data, sd = 1, return = "message")
Arguments
data |
A Standard Person Query dataset in the form of a data frame. |
sd |
The standard deviation below the mean for collaboration hours that should define an outlier week. Enter a positive number. Default is 1 standard deviation. |
return |
String specifying what to return. This must be one of the following strings:
See |
Value
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.
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_ch_ratio()
,
flag_em_ratio()
,
flag_extreme()
,
flag_outlooktime()
,
hr_trend()
,
hrvar_count()
,
hrvar_count_all()
,
hrvar_trend()
,
identify_churn()
,
identify_inactiveweeks()
,
identify_nkw()
,
identify_outlier()
,
identify_privacythreshold()
,
identify_shifts()
,
identify_tenure()
,
track_HR_change()
,
validation_report()
Examples
# Return a message by default
identify_holidayweeks(pq_data)
# Return plot
identify_holidayweeks(pq_data, return = "plot")