by-order: Ordering (sorting) rows of a data frame

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

Description

Ordering (sorting) rows of a data frame by the certain variables in the data frame. This function is essentially a wrapper for the order() function - the important difference being that variables to order by can be given by a model formula.

Usage

1

Arguments

formula

The right hand side of a formula

data

A dataframe

Details

The sign of the terms in the formula determines whether sorting should be ascending or decreasing; see examples below

Value

The ordered data frame

Author(s)

S<c3><b8>ren H<c3><b8>jsgaard, [email protected] and Kevin Wright

See Also

transformBy, splitBy

Examples

1
2
3
orderBy(~ conc + Treatment, CO2)
## Sort decreasingly by conc
orderBy(~ - conc + Treatment, CO2)

doBy documentation built on May 1, 2019, 6:31 p.m.