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

Improve warning message when passing a character vector to .before/.after #6718

Closed
arnaudgallou opened this issue Feb 11, 2023 · 1 comment
Closed

Comments

@arnaudgallou
Copy link

Here's the warning raised by the following code:

var <- "y"
tibble(y = seq(letters)) |> mutate(x = letters, .before = var)

# Using an external vector in selections was deprecated in tidyselect 1.1.0.
# ℹ Please use `all_of()` or `any_of()` instead.
#   # Was:
#   data %>% select(var)
#   
#   # Now:
#   data %>% select(all_of(var))
# See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
# This warning is displayed once every 8 hours.
# Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated. 

I find this warning message misleading and unclear. In a script using both select() and mutate(), the message distracts us from the actual function raising the warning. In a script with no select(), it's unclear the warning originate from mutate's .before/.after.

@DavisVaughan
Copy link
Member

Tracking in r-lib/tidyselect#334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants