will only warn and return a cleaned x.
util_ensure_in(x, set, err_msg, error = FALSE, applicability_problem = NA)character invisible(intersect(x, set))
character vector of needles
character vector representing the haystack
character optional error message. Use %s twice, once for the missing elements and once for proposals
logical if TRUE, the execution will stop with an error,
if not all x are elements of set, otherwise,
it will throw a warning and "clean" the vector x
from unexpected elements.
logical error indicates unsuitable resp_vars
Other robustness_functions:
util_as_valid_missing_codes(),
util_check_one_unique_value(),
util_correct_variable_use(),
util_empty(),
util_ensure_character(),
util_ensure_suggested(),
util_expect_scalar(),
util_fix_rstudio_bugs(),
util_is_integer(),
util_is_numeric_in(),
util_is_valid_missing_codes(),
util_match_arg(),
util_observations_in_subgroups(),
util_only_NAs(),
util_stop_if_not(),
util_warn_unordered()