When should I use setDT() instead of data.table() to create a data.table?

后端 未结 2 1452
盖世英雄少女心
盖世英雄少女心 2020-12-07 18:50

I am having difficulty grasping the essence of the setDT() function. As I read code on SO, I frequently come across the use of setDT() to create a

2条回答
  •  无人及你
    2020-12-07 19:33

    Update:

    @Roland makes some good points in the comments section, and the post is better for them. While I originally focused on memory overflow issues, he pointed out that even if this doesn't happen, memory management of various copies takes substantial time, which is a more common everyday concern. Examples of both issues have now been added as well.

    I like this question on stackoverflow because I think it is really about avoiding stack overflow in R when dealing with larger data sets.

提交回复
热议问题