powered by
Returns a sort order after sorting by a vector within another vector.
custom_sort(..., decreasing = FALSE, unique = FALSE)
Sequence of atomic vectors. Passed to order.
atomic
order
Sort order. Passed to order.
If FALSE (default), ties get the same rank. If TRUE, ties are broken.
FALSE
TRUE
numeric sort order.
numeric
# NOT RUN { a <- c(1, 1, 1, 2, 2) b <- c(2, 3, 2, 1, 1) custom_sort(a, b) custom_sort(b, a) custom_sort(b, a, unique = TRUE) # }
Run the code above in your browser using DataLab