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
Looking at this SO question, it seems useful:
require(data.table) dat <- setDT(structure(list(ID = c(97330L, 118619L, 101623L, 202626L, 182925L, 179278L), IV1 = c(3L, 0L, 2L, 0L, 1L, 1L), DV1 = c(0L, 0L, 0L, 0L, 1L, 0L), DV2 = c(0L, 0L, 0L, 0L, 0L, 0L), DV3 = c(0L, 0L, 0L, 0L, 0L, 0L), DV4 = c(0L, 0L, 0L, 0L, 0L, 0L), DV5 = c(0L, 1L, 0L, 0L, 0L, 0L), DV6 = c(1L, 1L, 0L, 0L, 0L, 0L), DV7 = c(0L, 0L, 0L, 0L, 0L, 0L)), .Names = c("ID", "IV1", "DV1", "DV2", "DV3", "DV4", "DV5", "DV6", "DV7"), class = "data.frame", row.names = c(NA, -6L))) dat[, sum(IV1), by=.(DV1, DV2, DV3, DV4, DV5, DV6, DV7)] # does work dat[, sum(IV1), by=DV1:DV7] # should work # DV1 DV2 DV3 DV4 DV5 DV6 DV7 V1 #1: 0 0 0 0 0 1 0 3 #2: 0 0 0 0 1 1 0 0 #3: 0 0 0 0 0 0 0 3 #4: 1 0 0 0 0 0 0 1
The text was updated successfully, but these errors were encountered:
I was thinking pretty much the same when saw this question :) I think there is a related FR for this though.
Sorry, something went wrong.
be308a3
Minor fix for #1395 so that by=1:nrow(dt) works as expected.
86c96b0
arunsrinivasan
No branches or pull requests
Looking at this SO question, it seems useful:
The text was updated successfully, but these errors were encountered: