Convert data.table to data.frame (i.e. undo setDT)

前端 未结 1 1434
无人及你
无人及你 2021-01-19 16:54

I have a 20x2 dataframe. I converted that dataframe to a data.table to perform some operations (deleted the explanation of the operations and goal as out of scope). The conv

相关标签:
1条回答
  • 2021-01-19 17:31

    Just like setDT() converts its input to a data table by reference, there is also setDF() which converts its input to a data frame by reference. So just call

    setDF(df)
    

    and you are back to a data frame with no copies made.

    0 讨论(0)
提交回复
热议问题