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

[R-Forge #2722] optimize j=c(lapply(.SD,sum),.N) #370

arunsrinivasan opened this Issue Jun 8, 2014 · 0 comments


None yet
1 participant

arunsrinivasan commented Jun 8, 2014

Submitted by: Sam Steingold; Assigned to: Arun ; R-Forge link

As reported here.

options(datatable.warnings = TRUE)
dt <- data.table(a = c(rep(3, 5), rep(4, 5)), b=1:10, c=11:20, d=21:30, key="a")
dt <- dt[, c(lapply(.SD,sum),.N), by=a]

results in an optimisation warnings, so I cannot discard the original table right away and have to resort to an intermediate one:

dt.out <- dt[, lapply(.SD, sum), by = a]
dt.out[, count := dt[, .N, by=a]$N]

@arunsrinivasan arunsrinivasan added this to the v1.9.4 milestone Jun 19, 2014

@arunsrinivasan arunsrinivasan added the High label Jun 20, 2014

@arunsrinivasan arunsrinivasan self-assigned this Jun 20, 2014

@arunsrinivasan arunsrinivasan referenced this issue Jul 15, 2014


Further optimisation of `.SD` in `j` #735

5 of 19 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment