Skip to content

read_csv coerces all column values to NA if 100 first observations are missing #128

@vincentarelbundock

Description

@vincentarelbundock

If the first 100 observations of a variable are missing, read_csv overwrites all column values with NAs (unless the column is boolean). Ideally, column type should be determined using the first 100 non-missing values of each column.

library(readr)
x = data.frame(matrix(rnorm(1000), ncol=5))
x$X1[1:100] = NA
write.csv(x, file='test.csv', row.names=FALSE)
y = read_csv('test.csv')
y$X1
problems(x)

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