specify_all_of() creates a function that will call stabilize_all_of()
with the provided specs. specify_all_of()'s function requires that x
satisfy every provided spec, and that all specs agree on the coerced
result.
Arguments
- ...
Unnamed stabilizer functions, forwarded to
stabilize_all_of().
Value
A function of class "stbl_specified_fn" that calls
stabilize_all_of() with the provided specs. The generated function will
also accept ... for additional unnamed specs to pass to
stabilize_all_of(). You can copy/paste the body of the resulting
function if you want to provide additional context or functionality.
See also
Other specification functions:
specify_any_of(),
specify_chr(),
specify_date(),
specify_dbl(),
specify_df(),
specify_dttm(),
specify_dur(),
specify_each(),
specify_fct(),
specify_int(),
specify_lgl(),
specify_lst(),
specify_one_of(),
specify_time()
Examples
stabilize_a_then_b <- specify_all_of(
specify_chr(regex = "^a"),
specify_chr(regex = "b$")
)
stabilize_a_then_b("ab")
#> [1] "ab"
try(stabilize_a_then_b("ba"))
#> Error in eval(expr, envir) :
#> `"ba"` must match all of the provided stabilizers.
#> ✖ `"ba"` must match the regex pattern "^a"