flag_extreme | R Documentation |
This is used as part of data validation to check if there are extreme values in the dataset.
flag_extreme(
data,
metric,
person = TRUE,
threshold,
mode = "above",
return = "message"
)
data |
A Standard Person Query dataset in the form of a data frame. |
metric |
A character string specifying the metric to test. |
person |
A logical value to specify whether to calculate
person-averages. Defaults to |
threshold |
Numeric value specifying the threshold for flagging. |
mode |
String determining mode to use for identifying extreme values.
|
return |
String specifying what to return. This must be one of the following strings:
See |
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.
"table"
: data frame. A person-level table with PersonId
and the
extreme values of the selected metric.
Other Data Validation:
check_query()
,
extract_hr()
,
flag_ch_ratio()
,
flag_em_ratio()
,
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()
# The threshold values are intentionally set low to trigger messages.
flag_extreme(pq_data, "Email_hours", threshold = 15)
# Return a summary table
flag_extreme(pq_data, "Email_hours", threshold = 15, return = "table")
# Person-week level
flag_extreme(pq_data, "Email_hours", person = FALSE, threshold = 15)
# Check for values equal to threshold
flag_extreme(pq_data, "Email_hours", person = TRUE, mode = "equal", threshold = 0)
# Check for values below threshold
flag_extreme(pq_data, "Email_hours", person = TRUE, mode = "below", threshold = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.