-
Notifications
You must be signed in to change notification settings - Fork 995
New issue
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
Understanding keyby changes in v1.9.8 #1958
Comments
Yes you"re right. News item 75 was :
The documentation for
That"s still true for the new behaviour for I"m looking at your new Going forward, yes I think I like your : setkeyv(y[, grp := .GRP, by = my_key], my_key) Although it"s longer than before, it"s clearer (well, given that we know y[, grp := .GRP, by = my_key][ keyby=my_key ] # keyby unhelpfully ignored Adding y[, grp := .GRP, by = my_key][, .SD, keyby=my_key ] # works and same as yours We should look at making sole To do what you need in one step though, how about introducing a new special symbol ?.GRP would change as follows :
Then your code would be a one letter change to : y[, grp := .GRPI, keyby = my_key] What do you and people following think? Perhaps |
+1 for lone |
I"ve seen something somewhere I think about lone |
Seems fine, but the name"s confusing. Based on the name, I would expect This seems related to #1494 re having Edit: Oh, and lone keyby is nice. |
lone keyby in #1105. |
Thanks for the careful explanation, Matt. I now properly understand what news item 75 means. I am happy to use Thanks for all your great work |
I encountered some failing unit tests in a package of mine that depends on data.table. I think this change in behaviour is due to point 30 at https://github.com/Rdatatable/data.table/blob/master/NEWS.md#new-features-1) and discussed in #1880. I don"t mind changing my code to keep up-to-date with changes in data.table, but I don"t understand exactly what is happening and would like to.
Here"s a reproducible example illustrating how I used to get the desired behaviour in v1.9.6, how that no longer works as of v1.9.8 (or v1.10.0), and my workaround in v1.9.8 (or v1.10.0).
Advice on how these changes have affected me and what the "data.table"-way to achieve my desired behaviour is much appreciated.
Using data.table v1.9.6
Using data.table v1.9.8 (or v1.10.0)
The text was updated successfully, but these errors were encountered: