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

arrange

Arrange entries in data.frame


Description

Analogous function for arrange in dplyr.

Usage

arrange(.data, ..., cols = NULL, order = 1L)

Arguments

.data

data.frame

...

Arrange by what group? Minus symbol means arrange by descending order.

cols

For set_arrange only. A character vector of column names of .data by which to order. If present, override .... Defaults to NULL.

order

For set_arrange only. An integer vector with only possible values of 1 and -1, corresponding to ascending and descending order. Defaults to 1.

Details

Once arranged, the order of entries would be changed forever.

Value

A data.table

See Also

Examples

a = as.data.table(iris)
a %>% arrange(Sepal.Length)
a
a %>% arrange(cols = c("Sepal.Width","Petal.Length"))
a

tidyft

Tidy Verbs for Fast Data Operations by Reference

v0.4.5
MIT + file LICENSE
Authors
Tian-Yuan Huang [aut, cre] (<https://orcid.org/0000-0002-3591-4203>)
Initial release

We don't support your browser anymore

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