Displaying 1 result from an estimated 1 matches for "327117".
Did you mean:
3271,17
2010 Dec 09
1
order matrix by column position
Hello all,
I'm trying to grasp a way to order a matrix by giving order() only a vector of the columns it can look to for sorting.
The approach has to be generic such that I can feed order() a vector of variable length (ie varying # of columns to sort by).
x<-rep(1,9)
y<-c(1, 1, 2, 2, 2, 1, 2, 2, 2)
z<-c(10, 11, 10, 13, 15,1000,1000, 1001,1002)
results<-cbind(x,y,z)
#pseudocode: