sortby: A function for sorting a data.frame by colname

Description Usage Arguments Value Examples

View source: R/dfmanipulation.R

Description

A function for sorting a data.frame by colname

Usage

1
sortby(x, by, decreasing = FALSE, na.last = NA)

Arguments

x

data.frame

by

colname (string) to sort by

decreasing

passed on, defaults to FALSE

na.last

passed on, defaults to NA

Value

A sorted data.frame

Examples

1
2
3
4
5
set.seed(42)
df = data.frame(start = 1:20,
                ran = sample(1:20, replace = TRUE))

sortby(df, "ran")

jacobfredsoee/LCEF documentation built on Jan. 9, 2020, 9:58 a.m.