Skip to content

read_csv errors with multiple column rows #224

Description

@ziyadsaeed

For files with multiple column rows, read_csv errors out even if i tell it not to read the rows with different columns using n_max. For eg

read_csv('param1, param2, param3
2, 3, "a"
var1, var2, var3, var4, var5
"a", 3,5,"b",6', 
n_max = 1)
Error: You have 3 column names, but 5 columns

It should read the first line as a header and the next line as the data and shouldn't go any further.
If i use skip = 2 so the first two lines are skipped then it works as expected. It read the third line as header and fourth as data

read.csv from base r has no problems reading the file with nrows = 1

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