R/flag_outlooktime.R
flag_outlooktime.RdThis function flags unusual outlook calendar settings for start and end time of work day.
flag_outlooktime(data, threshold = c(4, 15), return = "message")A different output is returned depending on the value passed to the return
argument:
"text": string. A diagnostic message.
"message": message on console. A diagnostic message.
"data": data frame. Data where flag is present.
See Value for more information.
Other Data Validation:
check_query(),
extract_hr(),
flag_ch_ratio(),
flag_em_ratio(),
flag_extreme(),
hr_trend(),
hrvar_count(),
hrvar_count_all(),
hrvar_trend(),
identify_churn(),
identify_holidayweeks(),
identify_inactiveweeks(),
identify_nkw(),
identify_outlier(),
identify_privacythreshold(),
identify_query(),
identify_shifts(),
identify_shifts_wp(),
identify_tenure(),
remove_outliers(),
standardise_pq(),
subject_validate(),
subject_validate_report(),
track_HR_change(),
validation_report()
# Demo with `dv_data`
flag_outlooktime(dv_data)
#> [Warning] 94.9% (832) of the person-date rows in the data have extreme Outlook settings.
#> 0% (0) have an Outlook workday shorter than 4 hours, while 94.9% (832) have a workday longer than 15 hours.
# Example where Outlook Start and End times are imputed
spq_df <- sq_data
spq_df$WorkingStartTimeSetInOutlook <- "6:30"
spq_df$WorkingEndTimeSetInOutlook <- "23:30"
# Return a message
flag_outlooktime(spq_df, threshold = c(5, 13))
#> [Warning] 100% (4403) of the person-date rows in the data have extreme Outlook settings.
#> 0% (0) have an Outlook workday shorter than 5 hours, while 100% (4403) have a workday longer than 13 hours.
# Return data
flag_outlooktime(spq_df, threshold = c(5, 13), return = "data")
#> # A tibble: 4,403 × 5
#> PersonId WorkdayRange WorkdayFlag WorkdayFlag1 WorkdayFlag2
#> <chr> <dbl> <lgl> <lgl> <lgl>
#> 1 93F763956FFC939A5DDE7D599… 17 TRUE FALSE TRUE
#> 2 93F763956FFC939A5DDE7D599… 17 TRUE FALSE TRUE
#> 3 93F763956FFC939A5DDE7D599… 17 TRUE FALSE TRUE
#> 4 93F763956FFC939A5DDE7D599… 17 TRUE FALSE TRUE
#> 5 93F763956FFC939A5DDE7D599… 17 TRUE FALSE TRUE
#> 6 93F763956FFC939A5DDE7D599… 17 TRUE FALSE TRUE
#> 7 93F763956FFC939A5DDE7D599… 17 TRUE FALSE TRUE
#> 8 0451CB55483735A680919F760… 17 TRUE FALSE TRUE
#> 9 0451CB55483735A680919F760… 17 TRUE FALSE TRUE
#> 10 0451CB55483735A680919F760… 17 TRUE FALSE TRUE
#> # ℹ 4,393 more rows