Yes, I reproduced your result with v1.9.2.
library(data.table) DT <- data.table(timestamp=c(as.POSIXct("2013-01-01 17:51:00.707"), as.POSIXct("2013-01-01 17:51:59.996"), as.POSIXct("2013-01-01 17:52:00.059"), as.POSIXct("2013-01-01 17:54:23.901"), as.POSIXct("2013-01-01 17:54:23.914"))) options(digits.secs=3)
Update v1.9.3 from Matt
In v1.9.2, a rounding change occurred that affected the POSIXct milliseconds. More details here:
Grouping very small numbers (e.g. 1e-28) and 0.0 in data.table v1.8.10 vs v1.9.2
Large integers in data.table. Grouping of results is different in 1.9.2 compared to 1.8.10
So, the workaround available in version 1.0 is:
> setNumericRounding(1)
I hope you understand why the change was made and agree that we are going in the right direction.
Of course, you do not need to call setNumericRounding() , this is just a workaround.
I registered a new tracker item:
# 5445 numeric rounding should be 0 or 1 automatically for POSIXct
hrbrmstr
source share