Cannot create new variables in data.table - could not find function ":="

I am always using the following syntax to create new variables:

dt.data[, x1:=log(x2+ 1)]

But I get the error (could not find function ":="); syntax used to run in the past but not any longer and I have no idea why.

Do you get the error with this test code? Be sure to run the library() function.

library(data.table)
DatTab <- data.table(A = 1:4, B = 2:5)
DatTab[, C := log(A + 1)]

It seems to be a package uploading issue. Cannot say atm which exactly.
Normally, I use EnsurePackage() and all works fine.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.