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) #v1.9.6 DT <- fread("user_id date weight 12345 2016-03-07 160 12345 2016-03-06 158 12345 2016-03-05 156 12345 2016-03-04 154")
I'm not sure why I can't just do
DT[, paste0("weight_", 1:.N) := shift(weight, 1:.N)] # Error in 1:.N : argument of length 0
Instead of
DT[, paste0("weight_", 1:nrow(DT)) := shift(weight, 1:.N)]
Is that a bug or I simply don't understand how .N works?
.N
Motivation: http://stackoverflow.com/questions/35855934/using-dplyrmutate-to-apply-parameterizations-of-a-function-to-a-single-data-fr?noredirect=1
The text was updated successfully, but these errors were encountered:
No. only on the RHS. But maybe we can get this to work.
Sorry, something went wrong.
Related #1543
I think subsumed by #581
No branches or pull requests
I'm not sure why I can't just do
Instead of
Is that a bug or I simply don't understand how
.N
works?Motivation: http://stackoverflow.com/questions/35855934/using-dplyrmutate-to-apply-parameterizations-of-a-function-to-a-single-data-fr?noredirect=1
The text was updated successfully, but these errors were encountered: