Last data update: 2014.03.03

R: Implements a 'sort' method for 'data.frame', sorting it in...
sort.data.frameR Documentation

Implements a sort method for data.frame, sorting it in lexicographic order.

Description

This function returns a data frame sorted in lexcographic order: first by the first column, ties broken by the second, remaining ties by the third, etc..

Usage

## S3 method for class 'data.frame'
sort(x, decreasing = FALSE, ...)

Arguments

x

A data.frame to sort.

decreasing

Whether to sort in decreasing order.

...

Ignored. Needed for compatibility with the generic.

Value

A data frame, sorted lexicographically.

See Also

data.frame, sort

Examples

data(iris)

head(iris)

head(sort(iris))

Results