df_arrange | R Documentation |
Order the rows of a data frame by values of specified columns.
Wrapper arround the arrange()
function. Supports
standard and non standard evaluation.
df_arrange(data, ..., vars = NULL, .by_group = FALSE)
data |
a data frame |
... |
One or more unquoted expressions (or variable names) separated by
commas. Used to select a variable of interest. Use
|
vars |
a character vector containing the variable names of interest. |
.by_group |
If TRUE, will sort first by grouping variable. Applies to grouped data frames only. |
a data frame
df <- head(ToothGrowth) df # Select column using standard evaluation df %>% df_arrange(vars = c("dose", "len")) # Select column using non-standard evaluation df %>% df_arrange(dose, desc(len))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.