[datatable-help] Subsetting Bug?

Arunkumar Srinivasan aragorn168b at gmail.com
Fri Nov 7 10:31:48 CET 2014


Ah I see. There’s no direct way yet. you’ll have to specify the right environment

dt[x == eval(quote(x), parent.frame())]

But we’re working on it to make these things simpler, and consistent.

Arun

On 7 Nov 2014 at 10:29:06, Michael Smith (my.r.help at gmail.com) wrote:

With 1.9.5 I get this (but how can I get the "outer" CIK?):  

> DT[CIK == (CIK)][FileDate <= 10104]  
CIK FileDate  
1: 0000060512 8680  
2: 0000839087 10081  
> DT[CIK == (CIK) & FileDate <= 10104]  
CIK FileDate  
1: 0000060512 8680  
2: 0000839087 10081  


On 11/07/2014 05:18 PM, Arunkumar Srinivasan wrote:  
> Which version please?  
> Did you try it with 1.9.5 to see if it’s been fixed already?  
>  
> Arun  
>  
> On 7 Nov 2014 at 09:51:57, Michael Smith (my.r.help at gmail.com  
> <mailto:my.r.help at gmail.com>) wrote:  
>  
>> Shouldn't the last two commands below yield identical results?  
>>  
>> DT <-  
>> data.table(  
>> CIK = c("0000060512", "0000839087"),  
>> FileDate = c(8680, 10081))  
>> CIK = "0000839087"  
>> DT[CIK == (CIK)][FileDate <= 10104]  
>>  
>> CIK FileDate  
>> 1: 0000839087 10081  
>>  
>> DT[CIK == (CIK) & FileDate <= 10104]  
>>  
>> CIK FileDate  
>> 1: 0000060512 8680  
>> 2: 0000839087 10081  
>> _______________________________________________  
>> 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/20141107/4c15f2b7/attachment.html>


More information about the datatable-help mailing list