arrange.: Arrange/reorder rows

Description Usage Arguments Examples

View source: R/arrange.R

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

1
arrange.(.df, ...)

Arguments

.df

A data.frame or data.table

...

Variables to arrange by

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
test_df <- data.table(
  a = 1:3,
  b = 4:6,
  c = c("a","a","b")
)

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

test_df %>%
  arrange.(c, desc(a))

mtfairbanks/gdt documentation built on May 4, 2021, 9:44 a.m.