<div dir="ltr">Gabor, <div><br></div><div>I think now I understand what your earlier post was about. You mean after the external by-without-by, doing DT1[DT2, ..., ] will be faster as it shouldn't do a by-without-by. Yes, that's true. So basically, the statement:</div>
<div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">dty[dtx, abs(x - y), roll = "nearest"]</span><br style="font-family:arial,sans-serif;font-size:13px"></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">once external by-without-by is implemented, will/should first do the join and then do the "j' operation. And therefore it'll be as fast as the solution I wrote. If one wants to perform the j-operation for each group, then they'll have to do something like </span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">DT1[, j, by=DT2] (or any other solutions we end up on)</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Sorry for the misunderstanding.</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 6, 2014 at 3:20 PM, Gabor Grothendieck <span dir="ltr"><<a href="mailto:ggrothendieck@gmail.com" target="_blank">ggrothendieck@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Thu, Feb 6, 2014 at 8:53 AM, Arunkumar Srinivasan<br>
<<a href="mailto:aragorn168b@gmail.com">aragorn168b@gmail.com</a>> wrote:<br>
> Not really. Because it still doing a "by". Meaning, for every grouping in<br>
> "by" - abs(x-y) will be evaluated. If there are 1e5 groups, there'll be 1e5<br>
> calls. And that can be expensive depending on the function + the time to<br>
> call eval from within C.<br>
><br>
> However, since it's not necessary to do a by-without-by, we can perform the<br>
> join and then compute once the difference between columns. There's no<br>
> grouping, no eval from C, and no multiple calls to abs. Hope this clears it<br>
> up?<br>
><br>
><br>
<br>
</div>In that case what is the proposed user interface?<br>
<br>
I thought that the idea was that one would have to explicitly specify<br>
the by= clause for by-within-by it to occur. In the code I had just<br>
posted there is a join = "nearest" but no by= clause is specified.<br>
</blockquote></div><br></div>