Skip to content
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

list(.SD$ with 'by' no longer respects group #779

Closed
malcook opened this issue Aug 21, 2014 · 2 comments
Closed

list(.SD$ with 'by' no longer respects group #779

malcook opened this issue Aug 21, 2014 · 2 comments

Comments

@malcook
Copy link

malcook commented Aug 21, 2014

back in this day, you could count on the following:

R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
...
> library(data.table)
data.table 1.9.2  For help type: help("data.table")
> data.table(mtcars)[,list(n=.N,hplist=list(hp)),by=cyl]
   cyl  n                     hplist
1:   6  7 110,110,110,105,123,123,
2:   4 11       93,62,95,66,52,65,
3:   8 14 175,245,180,180,180,205,

but no longer:

R version 3.1.0 (2014-04-10) -- "Spring Dance"
...
> library(data.table)
data.table 1.9.3  For help type: help("data.table")
> data.table(mtcars)[,list(n=.N,hplist=list(hp)),by=cyl]
   cyl  n                     hplist
1:   6  7 175,245,180,180,180,205,
2:   4 11 175,245,180,180,180,205,
3:   8 14 175,245,180,180,180,205,

## however there is a workaround:
> data.table(mtcars)[,list(n=.N,hplist=list(.SD[,hp])),by=cyl]
   cyl  n                     hplist
1:   6  7 110,110,110,105,123,123,
2:   4 11       93,62,95,66,52,65,
3:   8 14 175,245,180,180,180,205,
> 

This is HUGE change for me. Terrifying actually. Can I expect a fix?

Or is it me?

@arunsrinivasan
Copy link
Member

Malcolm, this bug, #481, has already been fixed. Maybe you're behind on v1.9.3? Could you try installing it again?

@malcook
Copy link
Author

malcook commented Aug 21, 2014

Arun - indeed - my latest package install was botched - the regression introduced in 1.9.2 now appears fixed at 1.9.3 in my hands - thanks for the insight....

@malcook malcook closed this as completed Aug 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants