11

The fread() function in the data.table package for R offers impressive speed and ease of use when reading large CSV files or such. Unfortunately I haven't managed to find a similar function to write CSV files from R. I have of course tried write.csv(), but I find it appallingly slow when writing really big data files.

So: does anyone know if there's anything similar to fread() for writing files?

5
  • If you have massive data a CSV might not be the best possibility to store it. Have you considered using a database?
    – Roland
    Oct 11, 2013 at 7:00
  • is writing in a .csv your actual goal? or just having your data stored on the disk? In which case you can update your question and we can start talking about ff package and similar solutions.
    – Michele
    Oct 12, 2013 at 11:12
  • 1
    fwrite for CSV was introduced in data.table 1.9.8 11/2016, issue #580 . Voting to reopen this.
    – smci
    Sep 12, 2018 at 1:09
  • This question should stay closed as it is a tool-request. The fact that the fwrite was introduced later doesn't change anything about that.
    – Jaap
    Sep 12, 2018 at 5:16
  • 1
    No, for two years now, this question is not a tool request and should have been reopened, since fwrite was added to data.table itself.
    – smci
    Sep 12, 2018 at 6:00

1 Answer 1

1

fwrite was introduced in data.table version 1.9.8, and is a very fast option for writing files. See the help page here.

Not the answer you're looking for? Browse other questions tagged or ask your own question.