[R] partially sorting?

ashley2000 ashley.askew2000 at gmail.com
Wed Jul 29 03:44:11 CEST 2009


Dear all,

x <-
matrix(c(1239,10,10,10,10,1234,10,10,10,10,1500,11,11,11,11,1001,11,11,11,11,
             
1009,11,11,11,11,1344,12,12,12,12,1349,12,12,12,12,1458,13,13,13,13),8,5,byrow
= T) 

> x
     [,1] [,2] [,3] [,4] [,5]
[1,] 1239   10   10   10   10
[2,] 1234   10   10   10   10
[3,] 1500   11   11   11   11
[4,] 1001   11   11   11   11
[5,] 1009   11   11   11   11
[6,] 1344   12   12   12   12
[7,] 1349   12   12   12   12
[8,] 1458   13   13   13   13

I tried to sort by 1st column, but stayed the other columns as they were. I
mean



     [,1] [,2] [,3] [,4] [,5]
[2,] 1234   10   10   10   10
[1,] 1239   10   10   10   10
--------------------------------------
[4,] 1001   11   11   11   11
[5,] 1009   11   11   11   11
[3,] 1500   11   11   11   11
--------------------------------------
[6,] 1344   12   12   12   12
[7,] 1349   12   12   12   12
--------------------------------------
[8,] 1458   13   13   13   13



any suggestions?

thanks 

ashley
-- 
View this message in context: http://www.nabble.com/partially-sorting--tp24710996p24710996.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list