Hi, I want to sort my matrix according to (any) selected column. For example given matrix: > x [,1] [,2] [,3] [1,] 3 4 7 [2,] 2 5 8 [3,] 1 6 9
I want to sort the first column in ascending order and make the other columns follow the 'new order' like: > x1 [,1] [,2] [,3] [1,] 1 6 9 [2,] 2 5 8 [3,] 3 4 7 thank in advance for help. best -- View this message in context: http://www.nabble.com/sorting-tp14983068p14983068.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.