Learn R Programming

tidytable (version 0.5.9)

arrange.: Arrange/reorder rows

Description

Order rows in ascending or descending order.

Note: data.table orders character columns slightly differently than dplyr::arrange() by ordering in the "C-locale". See ?data.table::setorder for more details.

Usage

arrange.(.df, ...)

Arguments

.df

A data.frame or data.table

...

Variables to arrange by

Examples

Run this code
# NOT RUN {
test_df <- data.table(
  a = c(1,2,3),
  b = c(4,5,6),
  c = c("a","a","b"))

test_df %>%
  arrange.(c, -a)
# }

Run the code above in your browser using DataLab