Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/xpssSortCases.R
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.
1 | xpssSortCases(x, variables = NULL, order ="A")
|
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 |
order |
atomic character or character vector containing either "A" for ascending order or "D" for descending order. |
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.
Returns a sorted xpssFrame.
Andreas Wygrabek
1 2 3 |
V1 V2 V3 V4 V5 V5_kl2 V6 V6_kl3 V7_1 V7_2
1 Audi A8 1 1 1.380 1 62.000 3 310 113.0
2 BMW 328i 1 1 9.231 1 33.400 3 193 107.3
3 Cadillac NA 2 1 6.536 1 NA NA 275 NA
4 Chevrolet Malibu 2 1 135.126 2 16.535 1 170 107.0
5 Chrysler 300M 2 1 30.696 2 29.184 2 253 113.0
6 Chrysler SebringCoupe 2 1 7.854 1 19.840 1 163 103.7
8 Dodge NA 2 2 16.767 1 NA NA 175 NA
7 Dodge RamPickup 2 2 227.061 2 19.460 1 230 138.6
9 Ford F-Series 2 2 80.620 2 26.934 2 220 138.5
10 Honda Accord 3 1 230.902 2 15.350 1 135 106.9
11 Lexus ES300 3 1 24.072 1 31.504 3 210 105.1
12 Lexus RX300 3 2 51.238 2 34.604 3 220 103.0
14 Mercedes-Benz CL500 1 1 0.954 1 85.500 3 302 113.6
13 Mercedes-Benz SLK230 1 1 1.526 1 41.000 3 185 94.5
15 Nissan Altima 3 1 88.094 2 20.390 2 155 103.1
16 Nissan NA 3 2 42.574 2 NA NA 170 NA
17 Nissan Xterra 3 2 54.158 2 22.798 2 170 104.3
18 Oldsmobile NA 2 2 24.361 1 NA NA 185 NA
19 Toyota Celica 3 1 33.269 2 16.875 1 140 102.4
20 Toyota LandCruiser 3 2 9.835 1 51.728 3 230 112.2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.