Learn R Programming

mets (version 1.3.4)

dsort: Sort data frame

Description

Sort data according to columns in data frame

Usage

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

Value

data.frame

Arguments

data

Data frame

x

variable to order by

...

additional variables to order by

decreasing

sort order (vector of length x)

return.order

return order

Examples

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

## with direct asignment
dsort(hubble) <- ~sigma-v

Run the code above in your browser using DataLab