-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
See also tidyverse/dplyr#7720
Alternative solution would be to implement eval_pull() and deprecate vars_pull() #189
b <- "a"
data <- data.frame(a = 1, b = 2)
tidyselect::vars_pull(
names(data),
tidyselect::all_of(b)
)
#> [1] "b"
tidyselect::eval_select(
rlang::quo(tidyselect::all_of(b)),
data
)
#> a
#> 1This shows up in dplyr's pull() and select() in weird ways
b <- "a"
dplyr::tibble(a = 1, b = 2) |>
dplyr::pull(dplyr::all_of(b))
#> [1] 2
dplyr::tibble(a = 1, b = 2) |>
dplyr::select(dplyr::all_of(b)) |>
dplyr::pull()
#> [1] 1I'm having trouble wrapping my mind around what is happening in the vars_pull() case
It's possible vars_pull() shouldn't allow all_of() or any_of() at all? That function is really for returning exactly 1 name, right? And it's likely that with all_of() and any_of() you can get >1? And it doesn't seem to be working right anyways (i.e. not pulling from the surrounding env)
Metadata
Metadata
Assignees
Labels
No labels