[datatable-help] changing data.table by-without-by syntax to require a "by"

Arunkumar Srinivasan aragorn168b at gmail.com
Tue Apr 30 09:58:37 CEST 2013


(The earlier message was too long and was rejected.) 
So, from the discussion so far, I see that Matthew is nice enough to implement `.JOIN` or `cross.apply`. I've a couple of questions. Suppose,

    DT1 <- data.table(x=c(1,1,2,3,3), y=1:5, z=6:10)
    setkey(DT1, "x")
    DT2 <- data.table(x=1)
    DT1[DT2, y, .JOIN=TRUE] # I guess the syntax is something like this. I expect here the same output as current DT1[DT2, y]

The above syntax seems "okay". But my first question is what is `.JOIN=FALSE` supposed to do under these two circumstances? Suppose, 

    DT1 <- data.table(x=c(1,1,2,3,3), y=1:5, z=6:10)
    setkey(DT1, "x")
    DT2 <- data.table(x=c(1,2,1), w=c(11:13))
    # what's the output supposed to be for?
    DT1[DT2, y, .JOIN=FALSE]
    DT1[DT2, .JOIN = FALSE]

Depending on this I'd have to think about `drop = TRUE/FALSE`. Also, how does it work with `subset`? 

    DT1[x %in% c(1,2,1), y, .JOIN=TRUE] # .JOIN is ignored?

Is this supposed to also do a "cross-apply" on the logical subset? I guess not. So, .JOIN is an "extra" parameter that comes into play *only* when `i` is a `data.table`? 

I'd love to have some replies to these questions for me to take a stance on `.JOIN`. Thank you.

Best,
Arun.






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20130430/bb0ee1c6/attachment.html>


More information about the datatable-help mailing list