Skip to content

tibble() gives inconsistent error messages for duplicate column names #291

@huftis

Description

@huftis

tibble() gives inconsistent error message for duplicate column names. See the following reprex:

library(tibble)
tibble(x1 = 1, x1 = 1)
#> Error: Column `x1` must have a unique name
tibble(x2 = 2, x1 = 1, x1 = 1)
#> Error: Column `x1` must have a unique name
tibble(x1 = 1, x1 = 1, x2 = 2)
#> Error: Data source must be a dictionary

Note that the last error message is different from the previous error messages, even though the cause of the error is identical.

I tested this with the latest GitGub version of the tibble package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions