Sort Rows

DESCRIPTION:

Sort the input dataset rows, according the values of one or more columns.

This function requires the bigdata library section to be loaded.

USAGE:

bd.sort(data, by.columns,
              ascending=T, na.last=F, alphabetic.factors=T)

REQUIRED ARGUMENTS:

data
input data set: a bdFrame or data.frame.
by.columns
names or numbers of columns whose elements are sorted. The first-named column is sorted first, then the second column is sorted within each element of the first column, and so on.

OPTIONAL ARGUMENTS:

ascending
if TRUE, the by.columns elements are sorted in ascending order.
If FALSE, they are sorted in descending order.
This argument can be a vector of logical values, to specify different values if there are multiple columns in by.columns.
na.last
if TRUE, any by.columns elements that are missing values are ordered after any non-missing values.
If FALSE, they are ordered before all of the non-missing values.
This argument can be a vector of logical values, to specify different values if there are multiple columns in by.columns.
alphabetic.factors
if TRUE, factor values are sorted alphabetically by the alphabetic order of the factor level strings.
If FALSE, factor values are sorted by the factor numbers.

VALUE:

A bdFrame or data.frame of the same type as data. Contains the sorted rows from the input dataset.

EXAMPLES:

## sort by Type name, and for each each value of this.
## sort by Mileage.
bd.sort(fuel.frame, c("Type", "Mileage"))