I think this is a bug.  DT.2 <- DT.1 doesn't seem to make a copy in all
cases.

> DT.1 <- data.table(x=1, y=1)
> DT.2 <- DT.1
>
> # Both DT.1 and DT.2 are changed.
> DT.2[, y := NULL]
     x
[1,] 1
> DT.1
     x
[1,] 1
> DT.2
     x
[1,] 1
>
> # Only DT.2 is changed
> DT.2[, y := x]
     x y
[1,] 1 1
> DT.1
     x
[1,] 1
> DT.2
     x y
[1,] 1 1
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to