Skip to content
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

Out of context all_of() should error #269

Closed
lionel- opened this issue Jun 27, 2022 · 3 comments · Fixed by #276
Closed

Out of context all_of() should error #269

lionel- opened this issue Jun 27, 2022 · 3 comments · Fixed by #276
Assignees
Labels
bug an unexpected problem or unintended behavior
Milestone

Comments

@lionel-
Copy link
Member

lionel- commented Jun 27, 2022

tidyselect::all_of("x")
#> [1] "x"

tidyselect::any_of("x")
#> Error:
#> ! `any_of()` must be used within a *selecting* function.
#> ℹ See <https://tidyselect.r-lib.org/reference/faq-selection-context.html>.
@hadley hadley added the bug an unexpected problem or unintended behavior label Aug 10, 2022
@hadley hadley added this to the next milestone Aug 10, 2022
@hadley
Copy link
Member

hadley commented Aug 10, 2022

I think it's worth looking into this, but I suspect there's some reason (i.e. a revdep failure?) that this doesn't already error.

@johnaponte
Copy link

johnaponte commented Jan 8, 2023

How to proceed with selecting columns with an external vector in summarize_at?:

I got this warning if using vars() with summarize_at:

 ## Warning: Using an external vector in selections was deprecated in tidyselect 1.1.0.
 ## ℹ Please use `all_of()` or `any_of()` instead.
 ##   # Was:
 ##   data %>% select(anavars)
 ## 
 ##   # Now:
 ##   data %>% select(all_of(anavars))
 ## 
 ## See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.

And got this warning if using all_of()

 ## Warning: Using `all_of()` outside of a selecting function was deprecated in tidyselect
 ## 1.2.0.
 ## ℹ See details at
 ##   <https://tidyselect.r-lib.org/reference/faq-selection-context.html>

@lionel-
Copy link
Member Author

lionel- commented Jan 9, 2023

@johnaponte Can you please show your code, ideally with a reprex?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants