-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add example of probable source of error to error message #241
Comments
Thanks for the suggestion. I think this message would be too specific since We could look into more specific help in tidyselect though. |
Maybe something like this? if (!missing(...)) {
abort(c(
"`...` should be empty.",
"i" = "Did you forget to use `c()`? You need `any_of(c('a', 'b'))`, not `any_of('a', 'b')`"
))
} Looks like |
Looks good. Just needs to use "must" instead of "should". Also "You need" sounds a bit authoritative, which could confuse users when the error is due to something else. Perhaps:
|
Just a very minor proposal to add to the error message at https://github.com/r-lib/rlang/blob/1a53bd085c8e0ed41dcc56cce334dde926da7067/R/dots-ellipsis.R#L169
"These dots only exist to allow future extensions and should be empty."
"Did you misspecify an argument?"
It seems a common way to reach this error is forgetting to use c() e.g. I was using any_of("a","b","c") when it should have been any_of(c("a","b","c"))
Would it be acceptable to add "Did you misspecify an argument? e.g. forget to use c()"?" to this error message? I think it could be helpful for beginners.
The text was updated successfully, but these errors were encountered: