sortDF {berryFunctions}R 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)


[Package berryFunctions version 1.20.1 Index]