-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
error in arrange when using across(everything()) #6495
Comments
Somewhat more minimal reprex: library(dplyr, warn.conflicts = FALSE)
df <- tibble(x = c(3, 1, 2))
arrange(df, TRUE, across(everything()))
#> Error in `arrange()`:
#> ! Can't compute `..2 = across(everything())`.
#> Caused by error:
#> ! ..1 used in an incorrect context, no ... to look in
#> Backtrace:
#> ▆
#> 1. ├─dplyr::arrange(df, TRUE, across(everything()))
#> 2. ├─dplyr:::arrange.data.frame(df, TRUE, across(everything())) at dplyr/R/arrange.R:82:2
#> 3. │ └─dplyr:::arrange_rows(.data, dots = dots, locale = .locale) at dplyr/R/arrange.R:97:2
#> 4. │ ├─dplyr::mutate(new_data_frame(data), !!!quosures, .keep = "none") at dplyr/R/arrange.R:129:2
#> 5. │ └─dplyr:::mutate.data.frame(...) at dplyr/R/mutate.R:146:2
#> 6. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...)) at dplyr/R/mutate.R:175:2
#> 7. │ ├─base::withCallingHandlers(...) at dplyr/R/mutate.R:244:2
#> 8. │ └─(function() {... at dplyr/R/mutate.R:244:2
#> 9. │ └─dplyr:::mutate_col(dots[[i]], .data, mask, new_columns) at dplyr/R/mutate.R:249:6
#> 10. │ └─mask$eval_all_mutate(quo) at dplyr/R/mutate.R:365:8
#> 11. │ └─dplyr (local) eval() at dplyr/R/data-mask.R:68:6
#> 12. ├─dplyr::across(everything())
#> 13. │ └─mask$pick(vars) at dplyr/R/across.R:235:4
#> 14. │ └─self$current_cols(vars) at dplyr/R/data-mask.R:77:6
#> 15. │ └─rlang::env_get_list(parent.env(private$mask), vars) at dplyr/R/data-mask.R:91:6
#> 16. ├─`<fn>`()
#> 17. └─base::.handleSimpleError(...)
#> 18. └─dplyr (local) h(simpleError(msg, call))
#> 19. └─rlang::abort(message, class = error_class, parent = parent, call = error_call) at dplyr/R/conditions.R:223:4 Created on 2022-10-10 with reprex v2.0.2 @DavisVaughan this is probably work taking a look at as part of your |
There are quite a few things going on here, one of which is this interesting tidbit: fn <- function() {
..1 <- 5
..1
}
fn()
#> Error in fn(): ..1 used in an incorrect context, no ... to look in Which is fairly similar to how our active binding setup works. So you can get stuff like this library(dplyr, warn.conflicts = FALSE)
df <- tibble(x = 1)
mutate(df, `..1` = 2, y = `..1` + 2)
#> Error in `mutate()`:
#> ℹ In argument: `y = ..1 + 2`.
#> Caused by error:
#> ! ..1 used in an incorrect context, no ... to look in Now the specific problem in Remember that in
So two things to think about:
|
Using dplyr_1.0.99.9000:
The text was updated successfully, but these errors were encountered: