Learn R Programming

Xmisc (version 0.2.1)

dfsort: Sort data.frame given levels of one column

Description

Sort data.frame given levels of one column

Usage

dfsort(x, which.col, levels)

Arguments

x
data.frame
which.col
column index or name
levels
character see base::factor

Value

data.frame

Examples

Run this code
data(CO2)
dfsort(CO2,"Treatment",c("nonchilled","chilled"))
dfsort(CO2,3,c("chilled","nonchilled"))

Run the code above in your browser using DataLab