Skip to content
Prev 77574 / 398502 Next

Sort a data frame with respect to more than one variable

Marc Bernard a ??crit :
> df[order(df$X), ] where df is  the data frame containing X.

probably not optimal, but simply why not ?
dfX  = df[order(df$X), ];
dfXY  = dfX[order(dfX$Y), ];
hih