sort.data.frame {mining}R Documentation

Sort rows of a data frame

Description

Re-orders data frame rows so that a column is sorted.

Usage

sort.data.frame(df,f=ncol(df))

Arguments

df a data frame
f the name or number of a column of df, or a numeric vector to play the role of a column of df.

Value

A reordered version of df where the values in column f are in ascending order.

Author(s)

Tom Minka

See Also

sort.cells

Examples

data(mtcars)
sort.data.frame(mtcars,"mpg")

[Package Contents]