Skip to content

Improve how fread's drop/select deal with duplicate column names #1899

@MichaelChirico

Description

@MichaelChirico

Consider

fread("x1,x1,y\n2,3,4", drop = "x1")
#    x1 y
# 1:  3 4
fread("x1,x1,y\n2,3,4", select = "x1")
#    x1
# 1:  2

x1 is duplicated. If both x1 are chosen by select, both should be excluded by drop. At the very least, there should be a warning about multiple x1 detected.

Use case is I have a .csv with a lot of columns called filler which are pointless white space. It would be nice to just say drop = "filler" and exclude all of them.

Originally filed on SO.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions