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

cur_column() isn't reset #5812

Closed
lionel- opened this issue Mar 11, 2021 · 1 comment · Fixed by #5816
Closed

cur_column() isn't reset #5812

lionel- opened this issue Mar 11, 2021 · 1 comment · Fixed by #5816
Assignees
Labels
bug an unexpected problem or unintended behavior

Comments

@lionel-
Copy link
Member

@lionel- lionel- commented Mar 11, 2021

library(dplyr)

cur_column()
#> Error: `cur_column()` must only be used inside `across()`.

tibble(x = 1:2, y = 3:4) %>%
  mutate(across(everything(), ~ cur_column()))
#> # A tibble: 2 x 2
#>   x     y
#>   <chr> <chr>
#> 1 x     y
#> 2 x     y

cur_column()
#> [1] "y"
@romainfrancois
Copy link
Member

@romainfrancois romainfrancois commented Mar 11, 2021

also a "top across" thing:

library(dplyr, warn.conflicts = FALSE)

cur_column()
#> Error: `cur_column()` must only be used inside `across()`.

tibble(x = 1:2, y = 3:4) %>%
  mutate(identity(across(everything(), ~ cur_column())))
#> # A tibble: 2 x 2
#>   x     y    
#>   <chr> <chr>
#> 1 x     y    
#> 2 x     y

cur_column()
#> Error: `cur_column()` must only be used inside `across()`.

Created on 2021-03-11 by the reprex package (v0.3.0)

@romainfrancois romainfrancois added the bug an unexpected problem or unintended behavior label Mar 11, 2021
@romainfrancois romainfrancois self-assigned this Mar 11, 2021
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.

2 participants