-
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
...
of across()
are evaluated too early?
#5813
Comments
😞 it's again because of the instrumented "top across", e.g. regular across works fine: library(dplyr, warn.conflicts = FALSE)
tibble(x = tibble(foo = 1)) %>%
mutate(identity(across(
everything(),
mutate,
foo = foo + 1
)))
#> # A tibble: 1 x 1
#> x$foo
#> <dbl>
#> 1 2 Created on 2021-03-11 by the reprex package (v0.3.0) |
Also, should it say ? Input `..1` is `dplyr:::top_across(...)` |
I think it's referring to the inner |
🤔 actually library(dplyr, warn.conflicts = FALSE)
tibble(x = tibble(foo = 1)) %>%
mutate(across(
everything(),
~mutate(.x, foo = foo + 1)
))
#> # A tibble: 1 x 1
#> x$foo
#> <dbl>
#> 1 2 Created on 2021-03-11 by the reprex package (v0.3.0) |
nevermind, it's "just" that |
Need to be careful about multiple evaluations though. If the mapped function is not a data masking function, the arguments inside The best thing is not to capture or collect |
Not sure why this doesn't work:
Ideally
across()
would work the same way asmap()
:The text was updated successfully, but these errors were encountered: