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
The assertion message doesn't show the original variable name
See reproducible example below (session info at the end):
foo<-function(arg1= c("a", "b", "c")) {
arg1<-checkmate::matchArg(arg1, choices= c("a", "b", "c"))
# ...
}
# Manual workaroundfoo2<-function(arg1= c("a", "b", "c")) {
arg1<-checkmate::matchArg(arg1, choices= c("a", "b", "c"), .var.name="arg1")
# ...
}
# Works great
foo("a")
# 'character(0)' instead of 'arg1'
foo("d")
#> Error in checkmate::matchArg(arg1, choices = c("a", "b", "c")): Assertion on 'character(0)' failed: Must be element of set {'a','b','c'}, but is not atomic scalar.# Work around
foo2("d")
#> Error in checkmate::matchArg(arg1, choices = c("a", "b", "c"), .var.name = "arg1"): Assertion on 'arg1' failed: Must be element of set {'a','b','c'}, but is not atomic scalar.
The assertion message doesn't show the original variable name
See reproducible example below (session info at the end):
Session info
The text was updated successfully, but these errors were encountered: