order_rows_specifically_in_dt: Order rows specifically in a data table

View source: R/order_rows_specifically_in_dt.R

order_rows_specifically_in_dtR Documentation

Order rows specifically in a data table

Description

Order rows in a data.table in a specific order

Usage

order_rows_specifically_in_dt(
  dt = NULL,
  col_to_order_by = NULL,
  specific_order = NULL
)

Arguments

dt

a data.table object

col_to_order_by

a character value indicating the name of the column by which to order the data.table

specific_order

a vector indicating a specific order of the values in the column by which to order the data.table.

Value

the output will be a data.table object whose rows will be ordered as specified.

Examples

order_rows_specifically_in_dt(mtcars, "carb", c(3, 2, 1, 4, 8, 6))

kim documentation built on Oct. 9, 2023, 5:08 p.m.