We are facing an abnormal situation where a data.table object seems to be assigned by reference instead of being copied by value. This situation shows up when using the operator ':='
(data.table -> 1.9.6 ; R -> 3.2)
Example:
a <- data.table(matrix(4,4,4))
b <- a
b[,`:=`(V5=6,V4=2)]
print(a)
This would happen also if the assignment is done with '='
Nevertheless, this wouldn't happen if we used b <- copy(a)
Can someone explain what's going on?