moodymudskipper / tb

IN ~PROGRESS my own take on `[.data.frame`
0 stars 0 forks source link

assignment by copy / reference #3

Closed moodymudskipper closed 4 years ago

moodymudskipper commented 5 years ago

data.table assigns by reference (in place) when we mutate using := in j, and it doesn't when we transmute or summarize using .().

You can also do both transformations by reference and transformations which will create a copy, which result in surprising behavior.

A function receiving a data.table as an argument can modify its input in the calling environment if the user is not careful.

We avoid this and aim for more consistency.