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

id option allows duplicate column names, ignores .name_repair #536

Open
khusmann opened this issue Apr 14, 2024 · 0 comments
Open

id option allows duplicate column names, ignores .name_repair #536

khusmann opened this issue Apr 14, 2024 · 0 comments

Comments

@khusmann
Copy link

By setting id to the name of one of the existing columns, I can get a tibble with duplicate column names (no matter what .name_repair is set to)

library(vroom)

vroom(I("a,hello\n1,2\n"), id="hello")
#> Rows: 1 Columns: 3
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> dbl (2): a, hello
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> # A tibble: 1 × 3
#>   hello                                  a hello
#>   <chr>                              <dbl> <dbl>
#> 1 /tmp/RtmpH8sYId/file1d51aa48b8ce78     1     2
vroom(I("a,hello\n1,2\n"), id="hello", .name_repair="minimal")
#> Rows: 1 Columns: 3
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> dbl (2): a, hello
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> # A tibble: 1 × 3
#>   hello                                  a hello
#>   <chr>                              <dbl> <dbl>
#> 1 /tmp/RtmpH8sYId/file1d51aa497bfadb     1     2
vroom(I("a,hello\n1,2\n"), id="hello", .name_repair="universal")
#> Rows: 1 Columns: 3
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> dbl (2): a, hello
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> # A tibble: 1 × 3
#>   hello                                  a hello
#>   <chr>                              <dbl> <dbl>
#> 1 /tmp/RtmpH8sYId/file1d51aa50745bec     1     2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant