powered by
roworder returns a permutation which rearranges the rows of its first argument into ascending order.
roworder
roworder(x, ...)
a matrix.
other arguments passed to order.
order
roworder returns an integer vector.
# NOT RUN { 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