-
Notifications
You must be signed in to change notification settings - Fork 998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fwrite doesn't save dates #1772
Comments
Duplicate of #1664. It's not yet implemented. What you're seeing is the internal representation. By setting |
When should I set the class attribute to Date? When fwriting or when reading back? And how? When I read back the csv file with fread the 1967-08-06 date still appears as -879 . |
After reading it back. |
OK, thank you. |
Since it seems there is no simple solution I'm trying to store column classes and change them back again. I've taken the original dataset ppp,
I save it on an file and I can read it next time.
And now I change the classes of the newly read dataset back to the original one.
The problem is that it works with this toy example but with the real big example I get the error:
I've also tried with |
@skanskan I would try |
Hello.
I have a dataset. I can choose to load it on R from a Stata file or from a SPSS file.
In both cases it's loaded properly with the haven package.
The dates are recognized properly.
But when I save it to disk with data.table's fwrite.
fwrite(ppp, "ppp.csv", sep=",", col.names = TRUE)
I have a problem, the dates dissapear and are converted to numbers with no sense.
For example the date 1967-08-06 now is -879
I've also tried playing with fwrite options, such as quote=FALSE, with no success.
I've uploaded a small sample of the files, the spss, the stata and the saved csv.
http://www73.zippyshare.com/v/OwzwbyQq/file.html
How can I solve it?
Regards
The text was updated successfully, but these errors were encountered: