Po kolejnym this post, mam inne pytanie dotyczące kolumn list w data.table
.Jak mogę wprowadzić klucz przez kolumnę list w data.table
DT = data.table(x=list(c(1,2),c(1,2),c(3,4,5)))
Wygląda na to, że nie można wpisać kolumny list.
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).
myślałem mogłem z list tej samej długości, ale:
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).
Czy istnieje obejście tego problemu? Jeśli nie, to co z prośbą o funkcję?
tak, 'list' jest niedozwolone (obecnie) jako kolumna klucza. Otrzymasz tę wiadomość, gdy wykonasz polecenie "setkey (DT," x ") – Arun