在这篇文章之后,我还有一个关于data.table
.
DT = data.table(x=list(c(1,2),c(1,2),c(3,4,5)))
似乎您无法键入一列列表。
DT[,y:=.I,by=x]
Erreur dans `[.data.table`(DT, , `:=`(y, .I), by = x) :
The items in the 'by' or 'keyby' list are length (2,2,3). Each must be same length as rows in x or number of rows returned by i (3).
我以为我可以使用相同长度的列表,但是:
DT = data.table(x=list(c(1,2),c(1,2),c(3,5)))
DT[,y:=.I,by=x]
Erreur dans `[.data.table`(DT, , `:=`(y, .I), by = x) :
The items in the 'by' or 'keyby' list are length (2,2,2). Each must be same length as rows in x or number of rows returned by i (3).
有解决方法吗?如果不是功能请求呢?