Closed DavisVaughan closed 1 year ago
i.e. list "foo" and "bar" rather than saying values in the error here
"foo"
"bar"
values
library(rlang) fn <- function(x) { arg_match0(x, values = c("foo", "bar")) } fn(c("a", "b")) #> Error in `arg_match()`: #> ! `arg` must be length 1 or a permutation of `values`. #> Backtrace: #> ▆ #> 1. ├─global fn(c("a", "b")) #> 2. │ └─rlang::arg_match0(x, values = c("foo", "bar")) #> 3. └─rlang:::stop_arg_match(w, x, y, z) #> 4. └─rlang::abort(msg, call = quote(arg_match()), arg = "arg")
Created on 2023-01-23 with reprex v2.0.2.9000
Oh and it looks like this needs to use the error_call?
error_call
i.e. list
"foo"
and"bar"
rather than sayingvalues
in the error hereCreated on 2023-01-23 with reprex v2.0.2.9000