In readr, the read_csv
command handles duplicate column names by renaming the second duplicate and leaves the first unaltered. See the following example, taken from https://github.com/tidyverse/readxl/issues/53.
readr::read_csv("x,x,y\n1,2,3\n")
#> Warning: Duplicated column names deduplicated: 'x' => 'x_1' [2]
#> # A tibble: 1 × 3
#> x x_1 y
#> <int> <int> <int>
#> 1 1 2 3
How can I get readxl::read_excel
handle duplicate columns the same way?