arrange_by | R Documentation |
Arranges a vector x
by the order of another vector by
.
arrange_by(x, by)
x |
Vector to be ordered. |
by |
Reference vector which |
Note that this function significantly differs from base::sort_by()
.
A permutation of x
.
library(magrittr)
# generate 100 random letters
random_letters <-
letters |>
magrittr::extract(sample.int(n = 26L,
size = 100L,
replace = TRUE)) %T>%
print()
# sort the random letters alphabetically
random_letters |> pal::arrange_by(by = letters)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.