Skip to contents

Sorts a data frame by one or more columns in ascending or descending order.

Usage

sortByCol(x, col, asc = TRUE)

Arguments

x

[data.frame]
Data.frame to sort.

col

[character]
One or more column names to sort x by. In order of preference.

asc

[logical]
Sort ascending (or descending)? One value per entry of col. If a scalar logical is passed, it is replicated. Default is TRUE.

Value

[data.frame].