We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
library(data.table) DT = data.table( a = c(1, 1, 2, 2), b = structure( c(0, 10, 0, 100000000), class = c('POSIXct', 'POSIXt') ) ) DT[ , diff(b), keyby = a] # a V1 # 1: 1 10.000 secs # 2: 2 1157.407 secs
The problem is that diff.POSIXt silently invokes -.POSIXt, which chooses units automatically given its inputs.
diff.POSIXt
-.POSIXt
These units are ignore on group wrapup:
DT[ , { x = diff(b) dput(x) x }, keyby = a] # structure(10, units = "secs", class = "difftime") # structure(1157.40740740741, units = "days", class = "difftime") # a V1 # 1: 1 10.000 secs # 2: 2 1157.407 secs
I suppose this is closely related with #995 and is almost identical to #761
The text was updated successfully, but these errors were encountered:
Hmm actually duplicate of #761.
Sorry, something went wrong.
No branches or pull requests
The problem is that
diff.POSIXt
silently invokes-.POSIXt
, which chooses units automatically given its inputs.These units are ignore on group wrapup:
I suppose this is closely related with #995 and is almost identical to #761
The text was updated successfully, but these errors were encountered: