xpssSortCases: Sorts data ascending or descending order

Description Usage Arguments Details Value Author(s) See Also Examples

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

1
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.

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.

Value

Returns a sorted xpssFrame.

Author(s)

Andreas Wygrabek

See Also

sort order

Examples

1
2
3
data(fromXPSS)

xpssSortCases(fromXPSS, variables = c("V4", "V7_1", "V7_2"), order = c("A","D","A"))


Search within the translateSPSS2R package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.