[datatable-help] About roll in data.table
statquant3
statquant at outlook.com
Tue Jun 25 15:37:51 CEST 2013
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.
More information about the datatable-help
mailing list