sort_by | R Documentation |
Sort an object by another object
sort_by(x, by, ...)
x |
A vector |
by |
Another vector |
... |
Additional arguments passed to |
The values of x
, resorted
l3 <- letters[1:3]
sort_by(l3, c(3, 2, 1))
# make a factor object with the reversed order
f <- factor(l3, levels = rev(l3))
sort_by(f, l3)
sort_by(1:3, rev(l3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.