[datatable-help] := when i is all false overwrites all values?

Chris Neff caneff at gmail.com
Wed Aug 31 21:23:13 CEST 2011


I didn't submit a bug report quite yet because I didn't know if this
was intended. Here is a simple example:

> dt <- data.table(x=1:10,y=1:10)
> dt[x==0]
NULL data table
> dt[x==0, y:=5L]
       x y
 [1,]  1 5
 [2,]  2 5
 [3,]  3 5
 [4,]  4 5
 [5,]  5 5
 [6,]  6 5
 [7,]  7 5
 [8,]  8 5
 [9,]  9 5
[10,] 10 5

I would expect the result to be that no values of y get changed.  This
is running the latest version from SVN. Is this working as intended?

-Chris


More information about the datatable-help mailing list