Learn R Programming

diyar (version 0.2.0)

custom_sort: Nested sorting

Description

Returns a sort order after sorting by a vector within another vector.

Usage

custom_sort(..., decreasing = FALSE)

Arguments

...

Sequence of atomic vectors. Passed to linkorder.

decreasing

Sort order. Passed to linkorder.

Value

numeric sort order.

Examples

Run this code
# NOT RUN {
a <- c(1, 1, 1, 2, 2)
b <- c(2, 3, 2, 1, 1)

custom_sort(a, b)
custom_sort(b, a)

# }

Run the code above in your browser using DataLab