data.table Advanced Technics A

编辑: -
Original Post

data.table Advanced Technics And Examples | Data Science With R


data.table是R语言的热门套件,能够快速处理大量资料,效率高于dplyr,且得利于语法结构的精巧设计,data.table更容易写出版排整齐的程式。这篇文章会讨论data.table的进阶技巧,在Cheat Sheat上也不一定找得到。

.GRP – Add index for each group

dt

C1 C2 INDEX1:A1 12:B2 23:C3 34:B2 25:A1 1Subset with row index and column index

dt

> dt_row C1C2C31:1 101 9012:2 102 902

> dt_colC2C31: 101 9012: 102 9023: 103 903

> dt_row_colC2C31: 101 9012: 102 902datatabledtindexc2rowexamples

你会喜欢下面的文章? You'll like the following article.