On Wed, Feb 5, 2014 at 10:42 AM, Arunkumar Srinivasan
<[email protected]> wrote:
> Seems like the "by-without-by" is what's slowing things down:
>
> require(data.table)
> dtx <- data.table(x=which(X), key="x")
> dty <- data.table(y=which(Y), key="y")
> dtx[, x1 := x]
> dty[, y1 := y]
> system.time(ans <- dty[dtx, roll="nearest"][, abs(x1-y1)])
>    user  system elapsed
>   1.321   0.076   1.396
> system.time(ans2 <- flodel(x,y))
>    user  system elapsed
>   0.936   0.044   0.977
>
> identical(ans, ans2) # [1] TRUE

What will the code look like after the explicit by-without-by feature is added?

-- 
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