roworder {docopulae} | R Documentation |
roworder
returns a permutation which rearranges the rows of its first argument into ascending order.
roworder(x, ...)
x |
a matrix. |
... |
other arguments passed to |
roworder
returns an integer vector.
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,]