util_ensure_in: similar to match.arg

View source: R/util_ensure_in.R

util_ensure_inR Documentation

similar to match.arg

Description

will only warn and return a cleaned x.

Usage

util_ensure_in(x, set, err_msg, error = FALSE, applicability_problem = NA)

Arguments

x

character vector of needles

set

character vector representing the haystack

err_msg

character optional error message. Use %s twice, once for the missing elements and once for proposals

error

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.

applicability_problem

logical error indicates unsuitable resp_vars

Value

character invisible(intersect(x, set))


dataquieR documentation built on July 26, 2023, 6:10 p.m.