sortDF: sortDF

Description Usage Arguments Value Examples

Description

sortDF is a convenience wrapper for sorting data.frames.

Usage

1
sortDF(data, decreasing = FALSE, by = NULL)

Arguments

data

data.frame to sort

decreasing

If TRUE, will be sorted in decreasing order

by

Variable name to sort by. If NULL, will sort by the first column

...

other arguments to be passed to order

Value

Sorted data.frame

Examples

1
2
3
4
5
6
7
#example_df <- data.frame(a = sample(letters[1:3], 10, replace = T),
#                         b = rnorm(10))
#sortDF(example_df)
#sortDF(example_df, by = "b")
#sortDF(example_df, decreasing = TRUE, by = "b")
#sortDF(example_df, by=c("a", "b"))
#sortDF(example_df, by=c("b", "a"))

TaylorAndrew/atExplore documentation built on May 9, 2019, 4:22 p.m.