You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test_fun<-function(one_allowed= c("1", "2", "3"), multiple=FALSE) {
rlang::arg_match(arg=one_allowed, multiple=multiple)
}
# bug: should give clear error that only one value is allowed
test_fun(c("1", "2"))
#> Error in `test_fun()`:#> ! `one_allowed` must be one of "1", "2", or "3", not "1".# correct:
test_fun("1")
#> [1] "1"
test_fun("2")
#> [1] "2"
test_fun(c("1", "2"), multiple=TRUE)
#> [1] "1" "2"
arg_check*
could produce better feedback when there is only one allowed argument value.Today: `chosen` must be one of "banana", not "apple".
Suggestion: `chosen` must be "banana", not "apple".
Created on 2023-06-22 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: