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
I encounter this problem too with the following example:
library(data.table) dt <- expand.grid( date = 1:10, time = 1:10, id = 1:5 ) setDT(dt, key = c("date", "time", "id")) dt[, x := runif(.N)] dt[time == 1, x1 := shift(x, type = "lead"), by = id]
previous producing
Key: <date, time, id> Index: <time> date time id x x1 <int> <int> <int> <num> <num> 1: 1 1 1 0.1217285 0.2041882 2: 1 1 2 0.2499479 0.3632787 3: 1 1 3 0.9992822 0.3553096 4: 1 1 4 0.9851168 0.1797294 5: 1 1 5 0.2273191 0.2967562 --- 496: 10 10 1 0.2503363 NA 497: 10 10 2 0.2226453 NA 498: 10 10 3 0.3320792 NA 499: 10 10 4 0.3255982 NA 500: 10 10 5 0.1976716 NA
but now producing
> dt Key: <date, time, id> Index: <time> date time id x x1 <int> <int> <int> <num> <list> 1: 1 1 1 0.74905819 0.59769795,0.30605044,0.74046541,0.08694826,0.24060779,0.89059279,... 2: 1 1 2 0.51506472 0.59769795,0.30605044,0.74046541,0.08694826,0.24060779,0.89059279,... 3: 1 1 3 0.82395315 0.59769795,0.30605044,0.74046541,0.08694826,0.24060779,0.89059279,... 4: 1 1 4 0.81986857 0.59769795,0.30605044,0.74046541,0.08694826,0.24060779,0.89059279,... 5: 1 1 5 0.78196531 0.59769795,0.30605044,0.74046541,0.08694826,0.24060779,0.89059279,... --- 496: 10 10 1 0.53337552 497: 10 10 2 0.03719923 498: 10 10 3 0.73477434 499: 10 10 4 0.03107033 500: 10 10 5 0.72256881
Originally posted by @renkun-ken in #5939 (comment)
The text was updated successfully, but these errors were encountered:
You may want to have a look to this example as well, I guess it is related: https://stackoverflow.com/q/78121802/20928710
Sorry, something went wrong.
Thanks @aattp, can you confirm the issue is fixed for you on current master?
master
Yes, it works using the current master!
Successfully merging a pull request may close this issue.
previous producing
but now producing
Originally posted by @renkun-ken in #5939 (comment)
The text was updated successfully, but these errors were encountered: