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

crossing() does not respect .name_repair #798

Closed
GegznaV opened this issue Nov 5, 2019 · 1 comment · Fixed by #816
Closed

crossing() does not respect .name_repair #798

GegznaV opened this issue Nov 5, 2019 · 1 comment · Fixed by #816
Labels
bug help wanted ❤️ pivoting ♻️

Comments

@GegznaV
Copy link

@GegznaV GegznaV commented Nov 5, 2019

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)

@hadley hadley added bug pivoting ♻️ help wanted ❤️ labels Nov 13, 2019
@hadley
Copy link
Member

@hadley hadley commented Nov 13, 2019

This looks like a fairly straightforward fix — expand() needs to get a .name_repair argument that gets passed on to flatten_nested(), which needs to get a .name_repair argument that's passed on to tibble(). expand() and expand_grid() would also need similar treatment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted ❤️ pivoting ♻️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants