Command Reference : Function Reference : Function Reference: R
  
 
@rowsort
Matrix where each row contains sorted columns.
Syntax: @rowsort(m[, o])
m: matrix, vector
o: (optional) string
Return: matrix, vector
Returns a matrix where each row contains the sorted values of the corresponding row of m.
The option o controls the direction of the ranking: ā€œaā€ (ascending - default) or ā€œdā€ (descending).
Examples
Let M1 be a matrix. Then
= @rowsort(m1, "d")
returns a matrix whose i-th row is the sorted (from largest on the left to smallest on the right) version of the i-th row in M1.
Cross-references
See also @sort and @colsort.
See also @ranks, @colranks, and @rowranks.
See also @capplyranks and @rapplyranks.