Skip to content
Prev 77575 / 398503 Next

Sort a data frame with respect to more than one variable

Le 21.09.2005 10:54, Marc Bernard a ??crit :
You already know the answer of that question. order() accepts more than 
one variable.

x <- rep(rbinom(5,size=4,prob=.5), 6)
y <- rnorm(30)
cbind(x,y)[ order(x,y) , ]

Romain