Nice! I don't see why not. It's a nice use of .EACHI. Perhaps you'd like to 
file it as a FR? It'd be easy to keep track then, for later, when Matt'll also 
have a look..

Arun

From: Gabor Grothendieck [email protected]
Reply: Gabor Grothendieck [email protected]
Date: June 30, 2014 at 8:41:51 PM
To: Arunkumar Srinivasan [email protected]
Cc: Stavros Macrakis (Σταῦρος Μακράκης) [email protected], datatable-help 
[email protected]
Subject:  Re: [datatable-help] Speeding up column references with roll  

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  
<[email protected]> wrote:  
> On Mon, Jun 30, 2014 at 1:00 PM, Arunkumar Srinivasan  
> <[email protected]> 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  
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to