Skip to content

across(.names =) evaluates "{col}" as if it was "{.col}" #7692

@arnaudgallou

Description

@arnaudgallou

It doesn't seem to be the expected behavior according to the documentation.

col <- "foo"

tibble::tibble(
  x = 1:3,
  y = 4:6
) |> 
  dplyr::mutate(
    dplyr::across(c(x, y), \(.x) .x * 2, .names = "{col}_{.col}")
  )
#> # A tibble: 3 × 4
#>       x     y   x_x   y_y
#>   <int> <int> <dbl> <dbl>
#> 1     1     4     2     8
#> 2     2     5     4    10
#> 3     3     6     6    12

packageVersion("dplyr")
#> [1] '1.1.4'

Created on 2025-06-09 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions