xpssSortCases: Sorts data ascending or descending order
Description
R implementation of the SPSS SORT CASES argument. xpssSortCases reorders the sequence of cases in the dataset based on the values of one or more variables.
Usage
xpssSortCases(x, variables = NULL, order ="A")
Arguments
x
a (non-empty) data.frame or input data of class "xpssFrame".
variables
atomic character or character vector with the names of the variables. Also rownames can be used to sort the data.
order
atomic character or character vector containing either "A" for ascending order or "D" for descending order.
Value
Returns a sorted xpssFrame.
Details
The argument order has to be of the same length as the argument variables. Optionally, the sorting can be specified in ascending or descending order for any variable. It is also possible to use combinations of ascending and descending order for different variables.