sort-methods: Convenience Methods to Sort Data Frames and Data Sets
Description
The methods below return a sorted version of
the data frame or data set, given as first argument.
Usage
# S3 method for data.frame
sort(x,decreasing=FALSE,by=NULL,na.last=NA,...)
# S3 method for data.set
sort(x,decreasing=FALSE,by=NULL,na.last=NA,...)
Value
A sorted copy of x.
Arguments
x
a data frame or data set.
decreasing
a logical value, should sorting
be in increasing or decreasing order?
by
a character name of variable names, by which to sort;
a formula giving the variables, by which to sort;
NULL, in which case, the data frame / data set
is sorted by all of its variables.
na.last
for controlling the treatment of 'NA's. If 'TRUE', missing
values in the data are put last; if 'FALSE', they are put
first; if 'NA', they are removed