sortby: Shortcuts for sorting data frames

Description Usage Arguments Details Value

View source: R/sortby.R

Description

Shortcuts for sorting data frames

Usage

1
2
3
4
5
6
7
sortby(df, key, decreasing = F, absolute = F)

rsortby(df, key, absolute = F)

rsortabs(df, key)

sortabs(df, key, decreasing = F)

Arguments

df

a data frame

key

column for sorting the data frame

abs

whether sort should be by absolute numeric values

Details

sortby sorts a data frame by column key. If absolute is TRUE, then the numeric values in column key will be first turned to absolute values with abs().

rsortby is the same as sortby(..., decreasing=T).

sortabs and rsortabs are the same as sortby and rsortby with parameter abs=TRUE.

Value

All functions return a sorted data frame.


january3/myfuncs documentation built on April 1, 2020, 4:42 a.m.