arrange.duckplyr_df {duckplyr} | R Documentation |
Order rows using column values
Description
This is a method for the dplyr::arrange()
generic.
See "Fallbacks" section for differences in implementation.
arrange()
orders the rows of a data frame by the values of selected
columns.
Unlike other dplyr verbs, arrange()
largely ignores grouping; you
need to explicitly mention grouping variables (or use .by_group = TRUE
)
in order to group by them, and functions of variables are evaluated
once per data frame, not once per group.
Usage
## S3 method for class 'duckplyr_df'
arrange(.data, ..., .by_group = FALSE, .locale = NULL)
Arguments
.data |
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). See Methods, below, for more details. |
... |
< |
.by_group |
If |
.locale |
The locale to sort character vectors in.
The C locale is not the same as English locales, such as |
Fallbacks
There is no DuckDB translation in arrange.duckplyr_df()
with
.by_group = TRUE
,providing a value for the
.locale
argument,providing a value for the
dplyr.legacy_locale
option.
These features fall back to dplyr::arrange()
, see vignette("fallback")
for details.
See Also
Examples
library(duckplyr)
arrange(mtcars, cyl, disp)
arrange(mtcars, desc(disp))