Skip to content

.name_repair in as_tibble() doesn't check the name for rownames coerced to a column #1070

@smped

Description

@smped

When providing an obviously dumb name for a new column containing rownames, .name_repair doesn't appear to check the name of the new column against existing columns

as_tibble(data.frame(a = 1:5), rownames = "a", .name_repair = "unique")
# A tibble: 5 × 2
  a         a
  <chr> <int>
1 1         1
2 2         2
3 3         3
4 4         4
5 5         5

To my understanding, this should spit the following message and output as the names

vctrs::vec_as_names(c("a", "a"), repair = "unique")
New names:
* a -> a...1
* a -> a...2
[1] "a...1" "a...2"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions