Make a shallow copy in data.table

I read in the SO thread tester from Matt Dole about the function shallowto make small copies in data.table. However, I can no longer find the topic.

data.tabledoes not have an exported function named shallow. There is internal, but not documented. Can I use it safely? What is his behavior?

What I would like to do is an efficient copy of a large table. Let be DTa large table with columns nand a ffunction whose memory effectively adds a column. Maybe something like that.

DT2 = f(DT)

c DT2is data.tablewith columns npointing to the original addresses (without deep copies) and an additional one that exists only for DT2. If so, what adds to DT1if I doDT2[, col3 := NULL]

+4
source share
1 answer

You cannot use it safely data.table:::shallow, no. It is not intentionally exported or intended for use by the user. Either from the point of view that he works, or his name or arguments will change in the future.

, , i) , := set* , ( ) ii) := set*, , . data.table, , .

: fooobar.com/questions/561263/...

: ? , ALTREP , , .

, . , , , . , ​​? data.table, , . R , - .

, "". , . , .

, , "[data.table] 39 ". , .

+2

Source: https://habr.com/ru/post/1684628/


All Articles