order: Implement the sort and order methods for
data.frame and matrix, sorting it in
lexicographic order.
Description
These function return a data frame sorted in lexcographic order or a
permutation that will rearrange it into lexicographic order: first by the
first column, ties broken by the second, remaining ties by the third, etc..
# S3 method for data.frame
sort(x, decreasing = FALSE, ...)
Value
For sort, a data frame, sorted lexicographically. For
order, a permutation I (of a vector 1:nrow(x)) such
that x[I,,drop=FALSE] equals x ordered lexicographically.
Arguments
...
Ignored for sort. For order, first argument is
the data frame to be ordered. (This is needed for compatibility with
order.)