-
Notifications
You must be signed in to change notification settings - Fork 144
Should quos_auto_name() use quo_name()? #573
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
Comments
This also looks suboptimal for the purpose of creating default column names: complex_var <- quote(mean(height, na.rm = TRUE, trim = 0.2))
quo_name(complex_var)
#> [1] "mean(height, na.rm = TRUE, trim = 0.2)" tibble::tibble(mean(1:10, na.rm = TRUE, trim = 0.2))
#> # A tibble: 1 x 1
#> `mean(1:10, na.rm = TRUE, trim = 0.2)`
#> <dbl>
#> 1 5.5 It probably makes sense to deparse the first argument and collapse the rest: quo_name(complex_var)
#> [1] "mean(height, ...)" Then might need to take the max number of arguments as an option, e.g. for |
Or use a different |
In addition: - Soft-deprecate the `width` argument of quos_auto_name() - Soft-deprecate passing a width as `.named` argument Closes r-lib#573
In addition: - Soft-deprecate the `width` argument of quos_auto_name() - Soft-deprecate passing a width as `.named` argument Closes r-lib#573
In addition: - Soft-deprecate the `width` argument of quos_auto_name() - Soft-deprecate passing a width as `.named` argument Closes r-lib#573
And should
expr_name()
deparse any kind of object?This is about suboptimal error messages like:
Caused by
quos_auto_name()
that usesexpr_text()
It doesn't seem to make sense to use a multi-line deparser to give default names to expressions? Then we should use
quo_name()
/expr_name()
. However they don't support literal objects:I think objects should be deparsed using the pillar sum type. Would that make sense? Then the error message above would become:
which makes more sense.
The text was updated successfully, but these errors were encountered: