Understanding exactly when a data.table is a reference to (vs a copy of) another data.table

I’m having a little trouble understanding the pass-by-reference properties of data.table. Some operations seem to ‘break’ the reference, and I’d like to understand exactly what’s happening. On creating a data.table from another data.table (via <-, then updating the new table by :=, the original table is also altered. This is expected, as per: ?data.table::copy and … Read more

What is The Rule of Three?

What does copying an object mean? What are the copy constructor and the copy assignment operator? When do I need to declare them myself? How can I prevent my objects from being copied? 8 Introduction C++ treats variables of user-defined types with value semantics. This means that objects are implicitly copied in various contexts, and … Read more