This function uses a combination of variable class, number of unique values, and regular expression matching to extract HR / organisational attributes from a data frame.
extract_hr(data, max_unique = 50, exclude_constants = TRUE, return = "names")A data frame to be passed through.
A numeric value representing the maximum number of unique values to accept for an HR attribute. Defaults to 50.
Logical value to specify whether single-value HR
attributes are to be excluded. Defaults to TRUE.
String specifying what to return. This must be one of the following strings:
"names"
"vars"
See Value for more information.
A different output is returned depending on the value passed to the return
argument:
"names": character vector identifying all the names of HR variables
present in the data.
"vars": data frame containing all the columns of HR variables present
in the data.
Other Support:
camel_clean(),
check_inputs(),
combine_signals(),
cut_hour(),
extract_date_range(),
heat_colours(),
is_date_format(),
maxmin(),
p_test(),
pairwise_count(),
plot_WOE(),
read_preamble(),
rgb2hex(),
totals_bind(),
totals_col(),
totals_reorder(),
tstamp(),
us_to_space(),
wrap()
Other Data Validation:
check_query(),
flag_ch_ratio(),
flag_em_ratio(),
flag_extreme(),
flag_outlooktime(),
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()
sq_data %>% extract_hr(return = "names")
#> [1] "FunctionType"     "LevelDesignation" "Organization"    
sq_data %>% extract_hr(return = "vars")
#> # A tibble: 4,403 × 3
#>    FunctionType LevelDesignation Organization    
#>    <chr>        <chr>            <chr>           
#>  1 G_and_A      Junior IC        Customer Service
#>  2 G_and_A      Junior IC        Customer Service
#>  3 G_and_A      Junior IC        Customer Service
#>  4 G_and_A      Junior IC        Customer Service
#>  5 G_and_A      Junior IC        Customer Service
#>  6 G_and_A      Junior IC        Customer Service
#>  7 G_and_A      Junior IC        Customer Service
#>  8 G_and_A      Manager          Customer Service
#>  9 G_and_A      Manager          Customer Service
#> 10 G_and_A      Manager          Customer Service
#> # ℹ 4,393 more rows