Skip to contents

Rows in the order of one or more columns: numbers, dates, and date-times by value, logicals from FALSE, strings by the code points of their characters, as in every host and locale, and factors by their levels. Missing cells and NaN come last, also in a column that descends. Rows that are equal in every column of by stay in the order they are in.

Usage

r8sort(x, by, descending = NULL, n_threads = NULL)

Arguments

x

A value of a table.

by

Character or numeric: The columns, the first foremost, by name or by position.

descending

Optional character or numeric: The columns of by that descend.

n_threads

Optional Integer [1, Inf): The threads that the work in Rust may use; NULL takes getOption("r8.n_threads"), whose default is half the logical cores, at most 2 where R CMD check limits the cores, and at most OMP_THREAD_LIMIT. A result is the same for any number of threads.

Value

A value of the type of x.

Examples

r <- Raven(site = c("b", "a", "b"), age = c(40, 52, 61))
r8sort(r, c("site", "age"), descending = "age")
#> <raven table> 3 rows ⨉ 2 columns
#>    site          age
#>    character  double
#> 1  a              52
#> 2  b              61
#> 3  b              40