[datatable-help] Speeding up column references with roll

Arunkumar Srinivasan aragorn168b at gmail.com
Tue Jul 1 06:59:28 CEST 2014


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 ggrothendieck at gmail.com
Reply: Gabor Grothendieck ggrothendieck at gmail.com
Date: June 30, 2014 at 8:41:51 PM
To: Arunkumar Srinivasan aragorn168b at gmail.com
Cc: Stavros Macrakis (Σταῦρος Μακράκης) macrakis at alum.mit.edu, datatable-help datatable-help at r-forge.wu-wien.ac.at
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  
<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  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20140701/f373bed1/attachment.html>


More information about the datatable-help mailing list