Dopo this post, ho un'altra domanda sulle colonne di elenchi in data.table
.Come posso digitare una colonna di elenchi in data.table
DT = data.table(x=list(c(1,2),c(1,2),c(3,4,5)))
Sembra che non sia possibile digitare una colonna di elenchi.
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).
ho pensato che avrei potuto con le liste di uguale lunghezza, ma:
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).
C'è una soluzione? Se no, che ne pensi di una richiesta di funzionalità?
sì, 'list' non è consentito (attualmente) come colonna chiave. Si ottiene questo messaggio quando si esegue 'setkey (DT," x ") – Arun