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?

LCHansson
  • 129
  • 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 '13 at 07: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 '13 at 11:12
  • 1
    `fwrite` for CSV was introduced in [data.table 1.9.8](https://www.rdocumentation.org/packages/data.table/versions/1.11.4/topics/fwrite) 11/2016, [issue #580](https://github.com/Rdatatable/data.table/issues/580) . Voting to reopen this. – smci Sep 12 '18 at 01: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 '18 at 05: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 '18 at 06:00

1 Answers1

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.

Gregor Thomas
  • 136,190
  • 20
  • 167
  • 294