-
Notifications
You must be signed in to change notification settings - Fork 58
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
summarize(across(where)) fails when using a predicate and acts unexpectedly with predicate negation #271
Comments
Unfortunately, these predicates do not work because the column type is (in general) not known. So, there is no other way than to explicitly name the columns to transform. Maybe other diamonds %>%
group_by(color) %>%
summarise(across(c(carat, depth:z), mean))
iris %>%
group_by(Species) %>%
summarise(across(matches("^Sepal|Petal"))) The error message is indeed not very helpful. When r-lib/tidyselect#226 is implement a more helpful error message can be implemented. |
I've ran into the same issue as well. It took me a while to discover why |
I have been trying to summarize across numeric columns using dtplyr and
summarise(across(where(is.numeric)))
and got the errorcan't rename variables in this context
. It took me quite a while to figure out the reason for the error is the usage of a predicate withinsummarize
is not possible with dtplyr.Is there any substitute for using
is.numeric
besides for naming all columns?Thank you
The following code 1) shows error when using predicate, 2) show how the negation does not fail and applies given function to all variables (numeric and non-numeric)
The text was updated successfully, but these errors were encountered: