I get .internal.selfref warning when executing the below three lines of code in R.
From the warning, I think the second line of the code makes a copy of the data.table without keeping proper references.
Can anyone explain how this occurs mechanically?
For example, replacing the second line with dt[, y:=1] resolves the issue, but I don't understand why.
My R version is 3.1.2.
> dt = data.table(x=1:2)
> dt[["y"]] = 1
> dt[, z:=1]
Warning message:
In `[.data.table`(dt, .`:=`(z, 1)) :
Invalid .internal.selfref detected ...