Learn R Programming

docopulae (version 0.2.1)

roworder: Matrix Ordering Permutation

Description

roworder returns a permutation which rearranges the rows of its first argument into ascending order.

Usage

roworder(x, ...)

Arguments

x
a matrix.
...
other arguments passed to order.

Value

  • roworder returns an integer vector.

See Also

order

Examples

Run this code
x = expand.grid(1:3, 1:2, 3:1)
x = x[sample(seq1(1, nrow(x)), nrow(x)),]
x

ord = roworder(x)
ord

x[ord,]

Run the code above in your browser using DataLab