arrange | R Documentation |
Order rows in ascending or descending order.
arrange(.df, ...)
.df |
A data.frame or data.table |
... |
Variables to arrange by |
df <- data.table(
a = 1:3,
b = 4:6,
c = c("a", "a", "b")
)
df %>%
arrange(c, -a)
df %>%
arrange(c, desc(a))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.