Skip to content

... of across() are evaluated too early? #5813

@lionel-

Description

@lionel-

Not sure why this doesn't work:

library(dplyr)

tibble(x = tibble(foo = 1)) %>%
  mutate(across(
    everything(),
    mutate,
    foo = foo + 1
  ))
#> Error: Problem with `mutate()` input `..1`.
#> ✖ object 'foo' not found
#> ℹ Input `..1` is `(function (.cols = everything(), .fns = NULL, ..., .names = NULL) ...`.

Ideally across() would work the same way as map():

tibble(x = tibble(foo = 1)) %>%
  map(
    mutate,
    foo = foo + 1
  )
#> $x
#> # A tibble: 1 x 1
#>     foo
#>   <dbl>
#> 1     2

Metadata

Metadata

Labels

bugan unexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions