You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to split data according to 15-minute timestamps; my approach is:
library(data.table)
set.seed(210349)
DT = data.table(t = sample(10000, 100), V = rnorm(100))
# t is in seconds, so 900 seconds is 15 minutes
DT[ , ID := .GRP, keyby = .(t %/% 900L)]
Warning message:
In [.data.table(DT, , :=(ID, .GRP), keyby = .(t%/%900L)) :
:= keyby not straightforward character column names or list() of column names, treating as a by:t%/%900
It's weird that this gives me a warning since it's purely related to the use of keyby:
# (no warning)
DT[order(t), ID := .GRP, by = .(t %/% 900L)]
(i in this case doesn't need to match that in by exactly)
I see, yes, good point. maybe a better warning would be along the lines of
"Cannot set key to an ad-hoc column, so skipping to setkey() following
computation of j"
I'm trying to split data according to 15-minute timestamps; my approach is:
It's weird that this gives me a warning since it's purely related to the use of
keyby
:(
i
in this case doesn't need to match that inby
exactly)For sanity:
What's the reason for this warning?
The text was updated successfully, but these errors were encountered: