R/flag_outlooktime.R
flag_outlooktime.Rd
This function flags unusual outlook calendar settings for start and end time of work day.
flag_outlooktime(data, threshold = c(4, 15), return = "message")
A data frame containing a Person Query.
A numeric vector of length two, specifying the hour threshold for flagging. Defaults to c(4, 15).
String specifying what to return. This must be one of the following strings:
"text"
(default)
"message"
"data"
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_all()
,
hrvar_count()
,
hrvar_trend()
,
identify_churn()
,
identify_holidayweeks()
,
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()
# 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% (13442) of the person-date rows in the data have extreme Outlook settings.
#> 0% (0) have an Outlook workday shorter than 5 hours, while 100% (13442) have a workday longer than 13 hours.
# Return data
flag_outlooktime(spq_df, threshold = c(5, 13), return = "data")
#> # A tibble: 13,442 × 5
#> PersonId Workd…¹ Workd…² Workd…³ Workd…⁴
#> <chr> <dbl> <lgl> <lgl> <lgl>
#> 1 93F763956FFC939A5DDE7D599D04923290B41C935ECA… 17 TRUE FALSE TRUE
#> 2 93F763956FFC939A5DDE7D599D04923290B41C935ECA… 17 TRUE FALSE TRUE
#> 3 93F763956FFC939A5DDE7D599D04923290B41C935ECA… 17 TRUE FALSE TRUE
#> 4 93F763956FFC939A5DDE7D599D04923290B41C935ECA… 17 TRUE FALSE TRUE
#> 5 93F763956FFC939A5DDE7D599D04923290B41C935ECA… 17 TRUE FALSE TRUE
#> 6 93F763956FFC939A5DDE7D599D04923290B41C935ECA… 17 TRUE FALSE TRUE
#> 7 93F763956FFC939A5DDE7D599D04923290B41C935ECA… 17 TRUE FALSE TRUE
#> 8 93F763956FFC939A5DDE7D599D04923290B41C935ECA… 17 TRUE FALSE TRUE
#> 9 93F763956FFC939A5DDE7D599D04923290B41C935ECA… 17 TRUE FALSE TRUE
#> 10 93F763956FFC939A5DDE7D599D04923290B41C935ECA… 17 TRUE FALSE TRUE
#> # … with 13,432 more rows, and abbreviated variable names ¹WorkdayRange,
#> # ²WorkdayFlag, ³WorkdayFlag1, ⁴WorkdayFlag2