Having installed data.table 1.9.7 in a windows machine, I have a data.table A where one of its columns is of Date type. I want to export A to a CSV file with fwrite but when I run
fwrite(A,file="out1.csv")
the Date column is transformed to IDate integer type. I need to keep the date format because this file will be used to a different application, not R. How can I not have the Date column transformed to IDate? My first attempt was to use
A[,theDate:=as.character(theDate)]
but it takes about 1000 seconds in a 100M rows data.table. Is there a way to avoid this?
This is now implemented and is fast. Please update to data.table
v1.9.8+.
You can control how dates are written with dateTimeAs="ISO"|"squash"|"epoch"|"write.csv"
. See the current version of fwrite
's manual page here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With