Learn R Programming

lava (version 1.4.5)

dsort: Sort data frame

Description

Sort data according to columns in data frame

Usage

dsort(data, x, ..., decreasing = FALSE)

Arguments

data
Data frame
x
variable to order by
...
additional variables to order by
decreasing
sort order (vector of length x)

Value

data.frame

Examples

Run this code
data(hubble)
dsort(hubble, "sigma")
dsort(hubble, hubble$sigma,"v")
dsort(hubble,~sigma+v)
dsort(hubble,~sigma-v)

Run the code above in your browser using DataLab