orderBy: Order a Data Frame by One or more Columns

View source: R/utils.R

orderByR Documentation

Order a Data Frame by One or more Columns

Description

Order a Data Frame by One or more Columns

Usage

orderBy(df, by = NULL, ...)

Arguments

df

data frame

by

vector of column names specifying the columns by which to order

...

further arguments passed to order, such as decreasing

Value

df being sorted and with newly renumbered rows

Examples

orderBy(iris, by = "Sepal.Length")
orderBy(iris, by = "Species", decreasing = TRUE)
orderBy(
  iris, 
  by = c("Species", "Petal.Width", "Petal.Length"), 
  decreasing = TRUE
)


KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.