sortDF: sort dataframes by column

View source: R/sortDF.R

sortDFR Documentation

sort dataframes by column

Description

sort a data.frame by column - basically just a wrapper for order

Usage

sortDF(df, col, decreasing = TRUE, quiet = FALSE, ...)

Arguments

df

Data.frame to be sorted

col

Column (index or (un)quoted name) to be sorted by

decreasing

Logical: should highest value be on top? DEFAULT: TRUE (unlike order!)

quiet

Logical: suppress non-df warning? DEFAULT: FALSE

...

Further arguments passed to order, like eg na.last or method

Value

data.frame

Author(s)

Berry Boessenkool, berry-b@gmx.de, June 2015

See Also

sort, order, insertRows, addRows

Examples

sortDF(USArrests[USArrests$Murder>11,], Assault)
sortDF(USArrests[USArrests$Murder>11,], "Assault") # safer within functions
sortDF(USArrests[USArrests$Murder>11,], 3)


berryFunctions documentation built on May 29, 2024, 4:01 a.m.