[datatable-help] := when i is all false overwrites all values?
Matthew Dowle
mdowle at mdowle.plus.com
Wed Aug 31 23:23:41 CEST 2011
Oops, that's a bug. Yes, please raise it on tracker.
Neither does this work correctly :
> dt[FALSE,y:=6L]
x y
[1,] 1 6
[2,] 2 6
[3,] 3 6
[4,] 4 6
[5,] 5 6
[6,] 6 6
[7,] 7 6
[8,] 8 6
[9,] 9 6
[10,] 10 6
>
On Wed, 2011-08-31 at 15:23 -0400, Chris Neff wrote:
> 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
> _______________________________________________
> 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