Description Usage Arguments Value Author(s) Examples
Order the rows of a data frame using variables identified in a formula evaluated in the data frame. Convenient in a pipeline.
1 | sordf( data, form )
|
data |
a data frame |
form |
a formula identifying variables to be used in sorting |
The formula is evaluated using model.frame
and the result is used as the argument of order
which, in turn is used to order the data frame. The ordered data frame is returned.
For example, using the Prestige data set in package:car and the pipeline function in package:magrittr, we can sort the data frame with:
> require(car) > require(magrittr) > Prestige
G. Monette
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.