Skip to content

crossing() does not respect .name_repair #798

@GegznaV

Description

@GegznaV

It seems that crossing() either does not respect the value of .name_repair or does not see this parameter:

vals <- c("v", "h")
tidyr::crossing(vals, vals, vals, vals, .name_repair = "unique")
#> Error: Column names `vals`, `vals`, `vals` must not be duplicated.
#> Use .name_repair to specify repair.

Created on 2019-11-05 by the reprex package (v0.3.0)

tibble() does not fail in this situation:

vals <- c("v", "h")
tidyr::tibble(vals, vals, vals, vals, .name_repair = "unique")
#> New names:
#> * vals -> vals...1
#> * vals -> vals...2
#> * vals -> vals...3
#> * vals -> vals...4
#> # A tibble: 2 x 4
#>   vals...1 vals...2 vals...3 vals...4
#>   <chr>    <chr>    <chr>    <chr>   
#> 1 v        v        v        v       
#> 2 h        h        h        h

Created on 2019-11-05 by the reprex package (v0.3.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorhelp wanted ❤️we'd love your help!pivoting ♻️pivot rectangular data to different "shapes"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions