[datatable-help] About roll in data.table
Eduard Antonyan
eduard.antonyan at gmail.com
Wed Jun 26 14:35:21 CEST 2013
Ok, so as far as I can tell, I understood what you want correctly. What are
your answers to my questions about this then?
What I thought about is the following,
whenever you use y[x,roll={-Inf,-a,a,Inf}] (say keyed by {t,u,v}) my
understanding is that data.table will
case 1) if there is a match on all keys do a regular join
case 2) if all but the last key match select the unique row if any such that
v of x is the prevailing value of y is rolled iif it is within the bounds
defined by the roll argument.
What I though about is there might be several rows in y that might be within
the roll bounds. Because of this and because we have a mult parameter that
can be {first,last,all} why not return the first/last/all the rows of y that
where in the bounds ?
This is what I call a window join, it is useffull if, say you want to
calculate a moving average or a function over all the past elements in the
last 2minutes...
I wrote a SO post about it (with no answer...)
http://stackoverflow.com/questions/17233973/is-it-possible-to-compute-any-window-join-in-data-table
--
View this message in context:
http://r.789695.n4.nabble.com/About-roll-in-data-table-tp4670023p4670279.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/20130626/de7b02c8/attachment.html>
More information about the datatable-help
mailing list