-
Notifications
You must be signed in to change notification settings - Fork 416
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
Confusing error message #805
Comments
I think we should compact missing arguments the same way we compact tidyselect::eval_select(quote(c(NULL, NULL)), iris)
#> named integer(0)
tidyselect::eval_select(quote(c(, )), iris)
#> Error: argument "x" is missing, with no default But also tidyr should either give a default value of |
I've been poking around other tidyr functions and many of them display the same problem ( |
@lionel- the code is currently: col <- tidyselect::vars_select(tbl_vars(data), !!enquo(col)) which will become: col <- tidyselect::vars_select(tbl_vars(data), {{ col }}) So it seems to me that it should be tidyselect's (or |
I was thinking tidyselect would not treat it as an error, but as an empty selection. This makes |
@lionel- so you think I should be doing |
Can you help me understand why it's different to this? library(rlang)
x <- expr()
expr(!!x)
#> Error in enexpr(expr): argument "x" is missing, with no default Created on 2019-11-26 by the reprex package (v0.3.0) |
In your example the missing argument is not wrapped in a quosure. Normally it would be wrapped via x <- quo()
expr(!!x)
#> <quosure>
#> expr: ^
#> env: empty |
Oh duh, yeah, still seems weird that I need to manually check that |
If you forget to specify the
col
whichunnest_wider()
should act on, it complains thatx
is missing. Feels like that should becol
. It's not entirely clear to me if this is a tidyr or tidyselect problemCreated on 2019-11-19 by the reprex package (v0.3.0.9001)
cc @lionel-
The text was updated successfully, but these errors were encountered: