0

Initial is a csv with lots of (178) columns and over 2mm rows, size around 2GB so read.csv definitely doesn't work in a useable time period. It has a bunch of empty spaces and even a couple of empty columns so it returns an error like the one below. I want to do the same thing as fill = TRUE parameter or if you have other creative ways of solving it, all would be appreciated.

initial_table <- sqldf("select * from initial", 
                        dbname = tempfile(),
                        file.format = list(header = T, row.names = F))\

Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  : 
line 8 did not have 137 elements
Community
  • 1
  • 1
jmi
  • 43
  • 4
  • It looks like the development (github) version of `fread` in `data.table` now supports the fill parameter. See http://stackoverflow.com/a/34197074/4190526 – Xiongbing Jin May 19 '16 at 20:02
  • Use the `filter=` argument to add empty fields. For examples of `filter` search the sqldf home page (https://github.com/ggrothendieck/sqldf) for the word `filter`. – G. Grothendieck May 20 '16 at 10:50

0 Answers0