sortBy: sort a dataframe by row according to columns.

View source: R/sortBy.R

sortByR Documentation

sort a dataframe by row according to columns.

Description

Returns a dataframe sorted by row according to the combination of values in the columns specified by "factors".

Usage

sortBy(df, factors, na.last = TRUE, ascending = TRUE, debug = FALSE)

Arguments

df
  • input dataframe (or object that can be cast to a dataframe)

factors
  • vector of desired column names from df to sort by

na.last
  • flag (T/F) to order NAs last/first (=NA removes any NAs)

ascending
  • flag (T/F) to sort in ascending/descending order

debug
  • flag (T/F) to print debugging info

Details

None.

Value

sorted version of df


wStockhausen/wtsUtilities documentation built on March 16, 2024, 10:38 a.m.