-
Notifications
You must be signed in to change notification settings - Fork 179
Closed
Labels
Description
If a column of a data frame is Date
or POSIXct
or POSIXlt
-class vector, they will be printed as integers in the column.
library(DT)
datatable(data.frame(date = seq(as.Date("2015-01-01"), by = "day", length.out = 5), x = 1:5))
will produce a DataTable like
date x
16436 1
16437 2
16438 3
16439 4
16440 5
The same thing does not happen with knitr::kable
:
> knitr::kable(data.frame(date = seq(as.Date("2015-01-01"), by = "day", length.out = 5), x = 1:5))
|date | x|
|:----------|--:|
|2015-01-01 | 1|
|2015-01-02 | 2|
|2015-01-03 | 3|
|2015-01-04 | 4|
|2015-01-05 | 5|