3
Classificar linhas em data.table em ordem decrescente na chave da string `order (-x, v)` gera erro no data.table 1.9.4 ou anterior
Digamos que eu tenho o seguinte data.tableem R: library(data.table) DT = data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6), v=1:9) Quero ordená-lo por duas colunas (digamos colunas xe v). Eu usei isso: DT[order(x,v)] # sorts first by x then by v (both in ascending order) Mas agora, quero classificá-lo por x(em ordem decrescente) e ter o …
125
r
string
sorting
data.table
key