Learn R Programming

dtplyr (version 1.3.1)

arrange.dtplyr_step: Arrange rows by column values

Description

This is a method for dplyr generic arrange(). It is translated to an order() call in the i argument of [.data.table.

Usage

# S3 method for dtplyr_step
arrange(.data, ..., .by_group = FALSE)

Arguments

.data

A lazy_dt().

...

<data-masking> Variables, or functions of variables. Use desc() to sort a variable in descending order.

.by_group

If TRUE, will sort first by grouping variable. Applies to grouped data frames only.

Examples

Run this code
library(dplyr, warn.conflicts = FALSE)

dt <- lazy_dt(mtcars)
dt %>% arrange(vs, cyl)
dt %>% arrange(desc(vs), cyl)
dt %>% arrange(across(mpg:disp))

Run the code above in your browser using DataLab