[datatable-help] Subsetting Bug?

Michael Smith my.r.help at gmail.com
Fri Nov 7 10:33:53 CET 2014


Version 1.9.4 in my original email.

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



(@Arun: sorry for double posting, I forgot to include the list email, so
that's why I'm sending again for completeness.)


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
>>


More information about the datatable-help mailing list