[datatable-help] About roll in data.table

Eduard Antonyan eduard.antonyan at gmail.com
Mon Jun 24 22:51:34 CEST 2013


I want to make sure I understand you correctly. In the example data.table
below, are you looking for d[J(2.1), roll = 1, mult = "all"] to return the
same rows (from 'b') as d[J(2), mult = "all"]?

d = data.table(a = c(1,2,2), b = c(1:3), key = 'a')

I think that's an interesting feature to have, but it's not obvious that
it'll work well with the rest of data.table. A few questions I have - would
you want the 'a' column to be the same as currently, i.e. get two rows with
a=2.1 in both? What about d[J(c(2.1,2.2)), roll = 1, mult = "all"] - what
would that do? What would you set the param defaults to get back current
behavior (which arguably is encountered much more frequently)?



On Fri, Jun 21, 2013 at 2:16 AM, statquant3 <statquant at outlook.com> wrote:

> I wrote a post on S.O
>
> http://stackoverflow.com/questions/17216843/rolling-joins-in-data-table-with-multiple-matches/17219629?noredirect=1#comment24955451_17219629
>
> It seems that when "roll" is specified in Y[X, roll=rollValue] even if
> there
> are several lines of Y that matches one row of X, just one is selected.
> I was looking for window joins like in kdb:
> http://code.kx.com/wiki/Reference/wj et I was thinking that because all
> the
> roll logic is already there, may be it would be a good feature to get all
> rows matched when roll is specified.
>
> What do you think ?
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/About-roll-in-data-table-tp4670023.html
> Sent from the datatable-help mailing list archive at Nabble.com.
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20130624/4f227c3a/attachment.html>


More information about the datatable-help mailing list