library(rlang)
fn <- function(x) {
arg_match(x, values = c("a", "b"))
}
fn2 <- function(x) {
arg_match0(x, values = c("a", "b"))
}
fn(1)
#> Error in `fn()`:
#> ! `x` must be a character vector, not the number 1.
fn2(1)
#> Error in `fn2()`:
#> ! `x` must be a string or character vector.
Looks like maybe the first one uses check_character()? This isn't a huge deal if its hard to do
Looks like maybe the first one uses
check_character()
? This isn't a huge deal if its hard to do