0

I'm having trouble with the data.table package in R (v1.9.6). I'm not sure what I'm doing wrong. Any help is much appreciated.

I create a data.table and then assign this to a new variable. So now I have two data.tables. I then perform an operation on the second data.table. However this operation is also performed on the original data.table as well. Is this a bug or a feature of the package? or am I doing something horribly wrong?

a<-data.table(x=1:100,y=1:100)

b<-a

b[,x:=2]

head(a)

head(b)
mat
  • 21
  • 4

0 Answers0