[datatable-help] i =?utf-8?Q?=3D_?=!x different from i =?utf-8?Q?=3D_?=(!x)

Arunkumar Srinivasan aragorn168b at gmail.com
Mon Jun 30 18:50:32 CEST 2014


Not at the moment because of the checks. If it's a call, and the first index value is `!`, it's removed and then the rest is checked if it's a "name", which is true for `t1[!b]`. And i by default searches the calling scope - because `i` can be a data.table. That is, `X[!Y]` is intended to be used for `Y` being a data.table. Hence the difference between `X[!Y]` and `X[(!Y)]` at the moment.

But in 1.9.3, this'll get better: Have a look at https://github.com/Rdatatable/data.table/issues/697 and https://github.com/Rdatatable/data.table/issues/633

Arun

From: Stavros Macrakis (Σταῦρος Μακράκης) macrakis at alum.mit.edu
Reply: Stavros Macrakis (Σταῦρος Μακράκης) macrakis at alum.mit.edu
Date: June 30, 2014 at 6:06:53 PM
To: datatable-help at r-forge.wu-wien.ac.at datatable-help at r-forge.wu-wien.ac.at
Subject:  [datatable-help] i = !x different from i = (!x)  

DT 1.9.2

t1 <- data.table(a=1:2,b=0:1,key="a")

t1[b==0] => row 1, OK
t1[!b] => ERROR "object 'b' not found" ??
t1[(!b)] => row 1, OK

Shouldn't !b be equivalent to (!b)? They are both expressions, not symbols.

         -s
_______________________________________________  
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/20140630/c77a71a3/attachment-0001.html>


More information about the datatable-help mailing list