[datatable-help] Speeding up column references with roll

Gabor Grothendieck ggrothendieck at gmail.com
Mon Jun 30 20:41:30 CEST 2014


One other comment. I wonder if .EACHI could mean by each row if there
were no join specified so this:

library(data.table)
DT <- data.table(
    v1 = factor(c("a", "a", "a", "b", "b", "b")),
    v2 = c(1, 1, 6, 3, 4, 5),
    v3 = c("a", "b", "c", "a", "b", "c"),
    stringsAsFactors=FALSE
)
DT[, c(.SD, split(v2, v1)), by = 1:nrow(DT)][, -1, with = FALSE]

could be written:

DT[, c(.SD, split(v2, v1)), by = .EACHI]

or maybe even:

DT[, split(v2, v1), by = c(names(DT), .EACHI)]


On Mon, Jun 30, 2014 at 2:21 PM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
> On Mon, Jun 30, 2014 at 1:00 PM, Arunkumar Srinivasan
> <aragorn168b at gmail.com> wrote:
>> Once again, has been fixed in 1.9.3. Now join requires `by=.EACHI`
>> (explicit) to perform a by-without-by.
>> https://github.com/Rdatatable/data.table/blob/master/README.md
>
> The README would be easier to understand if DT was not undefined in
> the README. As it stands none of the examples are runnable.



-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com


More information about the datatable-help mailing list