Skip to content

bumping lots of columns in fread makes R crash #722

@richierocks

Description

@richierocks

When fread has to bump many columns to a different data type, R can crash. This dataset with 10k rows and 40 columns makes R consistently crash:

library(data.table)

# Create a character column that is mostly empty,
# so it gets bumped.
x <- character(1e4)
x[9994] <- "+"
# For very powerful machines, you might need to  
# increase the number of rows a little.
dfr <- as.data.frame(
  replicate(40, x, simplify = FALSE)
)
write.table(dfr, "test.txt", quote = FALSE)

fread("test.txt")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions