sym_sort | R Documentation |
Sort a vector symmetrically, i.e., the two most extreme values are put at opposite ends and repeated until the median value(s) is(are) put in the middle of the sorted vector.
sym_sort(x, rev = FALSE, index.return = FALSE)
x |
a numeric, complex, character, or logical vector |
rev |
logical; if |
index.return |
logical; if |
kinda_sort
sym_sort(letters)
sym_sort(letters, rev = TRUE)
x <- runif(50)
plot(sym_sort(x))
plot(x[sym_sort(x, index.return = TRUE)])
plot(sym_sort(x, rev = TRUE))
plot(-sym_sort(-x, rev = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.