Thx Eduard - it's about 5% faster your way according to rbenchmark.  Hey,
latency is latency....just got a need for speed...

Best,

John


On Wed, Aug 14, 2013 at 9:58 AM, Eduard Antonyan
<[email protected]>wrote:

> you could use Days %in% c(1,5,10,20,30,60,90) instead, or iff Days is the
> first key J(c(1,5,10,20,30,60,90))
>
>
> On Wed, Aug 14, 2013 at 9:30 AM, John Kerpel <[email protected]>wrote:
>
>> 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
>>
>> _______________________________________________
>> datatable-help mailing list
>> [email protected]
>>
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>>
>
>
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to