Let\'s say I have the following data.table in R:
data.table
R
library(data.table) DT = data.table(x=rep(c(\"b\",\"a\",\"c\"),each=3), y=c(1,3,6)
DT[order(-x)] works as expected. I have data.table version 1.9.4. Maybe this was fixed in a recent version. Also, I suggest the setorder(DT, -x) syntax in keeping with the set* commands like setnames, setkey
DT[order(-x)]
setorder(DT, -x)
setnames
setkey