[datatable-help] Writing a good "WHERE" statement

John Kerpel john.kerpel2 at gmail.com
Wed Aug 14 16:30:29 CEST 2013


Folks:

I've been working more and more in data.table and it gets better and better
as I learn to use it....

So my question is, in the following example, is the Where statement
inefficient because I'm using "==" ?  (I just want to use the subsets where
days are equal to the values in the statement)

Should I do this another way? (Btw, I get exactly the right answer using
this approach...)

db <- DB4[

  Days==1 | Days==5 | Days==10 | Days==20 | Days==30 | Days==60 | Days==90,

  j =   {list(v=m_func(x,y,z))},

  by= "Date,Indicator,Days"

  ]

If more detail is necessary, lmk. Date, Indicator, and Days are keys.

Best,

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


More information about the datatable-help mailing list