ascend_rows: Arranging rows by selected variables

View source: R/ascend_rows.R

ascend_rowsR Documentation

Arranging rows by selected variables

Description

Arranging rows of data in the data.table by selected variables in ascending order. This is similar to the arrange() function in the dplyr package.

Usage

ascend_rows(dt, ...)

Arguments

dt

input data.table

...

column names or a vector of characters of column names in the data.table to be used for ordering the raws of data

Examples

## Not run: 
 # in descending order by values in weight and mpg
 dt <- data1 |> data.table()

 dt |> ascend_rows(wt, mpg)

 # group using cyl and order by wt and mpg
 dt |> set_group(cyl) |> ascend_rows(wt, mpg)

## End(Not run)

kleu046/wr.data.table documentation built on April 25, 2022, 1:41 p.m.