sortdf: Order the rows of a data frame

Description Usage Arguments Value Examples

Description

Order the rows of a data frame using variables identified in a formula evaluated in the data frame. Convenient in a pipeline.

Usage

1
sortdf(data, form)

Arguments

data

a data frame

form

a formula identifying variables to be used in sorting

Value

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.

Examples

1
2
3
4
5
6
## Not run: 
require(car)
require(magrittr)
Prestige  %>% sortdf(~type+income) -> Prestige.ordered

## End(Not run)

gmonette/yscs documentation built on May 17, 2019, 7:28 a.m.