Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

arrange..html

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

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))

tidytable

Tidy Interface to 'data.table'

v0.6.1
MIT + file LICENSE
Authors
Mark Fairbanks [aut, cre], Abdessabour Moutik [ctb], Matt Carlson [ctb], Ivan Leung [ctb], Ross Kennedy [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.