我使用以下命令:
table(factor("list",levels=1:"n")
使用 "list": (example) a = c(1,3,4,4,3) and levels = 1:5,还要考虑 2 和 5。对于非常大的数据集,我的代码似乎非常无效。
a = c(1,3,4,4,3)
levels = 1:5
有没有人知道隐藏的库或代码片段以使其更快?
performance r count tabulate
count ×1
performance ×1
r ×1
tabulate ×1