Learn R Programming

tidyft (version 0.9.20)

arrange: Arrange entries in data.frame

Description

Analogous function for arrange in dplyr.

Usage

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

Value

A data.table

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.

See Also

Examples

Run this code

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

Run the code above in your browser using DataLab