specify_any_of() creates a function that will call stabilize_any_of()
with the provided specs. specify_any_of()'s function tries each spec in
order and returns the result of the first one that succeeds.
Arguments
- ...
Unnamed stabilizer /
to_*/specify_*()specs, forwarded tostabilize_any_of().
Value
A function of class "stbl_specified_fn" that calls
stabilize_any_of() with the provided specs. The generated function will
also accept ... for additional unnamed specs to pass to
stabilize_any_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_all_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_int_or_chr <- specify_any_of(specify_int(), specify_chr())
stabilize_int_or_chr(1L)
#> [1] 1
stabilize_int_or_chr("a")
#> [1] "a"
try(stabilize_int_or_chr(TRUE))
#> [1] 1