-
Notifications
You must be signed in to change notification settings - Fork 181
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
Fail to preserve Date object #13
Labels
Comments
That is a problem of RJSONIO. Sigh. It seems every single problem of RJSONIO has been well solved in jsonlite, but we are just stuck in RJSONIO: > x = data.frame(date = seq(as.Date("2015-01-01"), by = "day", length.out = 5), x = 1:5)
> RJSONIO::toJSON(x)
[1] "{\n \"date\": [ 16436, 16437, 16438, 16439, 16440 ],\n\"x\": [ 1, 2, 3, 4, 5 ] \n}"
> jsonlite::toJSON(x)
[{"date":"2015-01-01","x":1},{"date":"2015-01-02","x":2},{"date":"2015-01-03","x":3},{"date":"2015-01-04","x":4},{"date":"2015-01-05","x":5}] |
@yihui are you in the middle of solving this? I just installed the latest DT and when a DT has date columns it doesn't print anything |
Should be "fixed" now. Thanks! |
Appreciate your work! Will try it out. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If a column of a data frame is
Date
orPOSIXct
orPOSIXlt
-class vector, they will be printed as integers in the column.will produce a DataTable like
The same thing does not happen with
knitr::kable
:The text was updated successfully, but these errors were encountered: