Size of the column is the usual Euclidean norm.
srtdR = gtm_sort(R)
R
srtdR - the corresponding sorted matrix
srtdR
m = matrix( c(1,4,2,7,1,3), nrow=2) gtm_sort(m)