Late to the party, but I know what you're asking
There is no direct answer, but here is a workaround.
test[,x,by=x][,x] # Suppress one of the x's [1] "a" "b"
invisible () should also work as follows:
Im uses j only for its side effect, but Im still returns data. How to stop it? In this case, j can be wrapped invisible (); for example, DT [, invisible (hist (colB)), through = colA] http://datatable.r-forge.r-project.org/datatable-faq.pdf
Or that would also be a solution.
test[,invisible(x),by=x]
However, the following may make you happily abandon the quest:
Why is column grouping in a key faster than ad hoc?
Since each group is contiguous in RAM, thus minimizing the selection of pages and memory can be copied in bulk (memcpy in C) and not in the C loop. Http://datatable.r-forge.r-project.org/datatable -faq.pdf
source share