arrange {dplyr} | R Documentation

## Arrange rows by variables.

### Description

Use `desc` to sort a variable in descending order.

### Usage

    arrange(.data, ...)

    arrange_(.data, ..., .dots)

### Arguments

`.data` | A tbl. All main verbs are S3 generics and provide methods for `tbl_df`, `tbl_dt` and `tbl_sql`.
`...` | Comma separated list of unquoted variable names. Use `desc` to sort a variable in descending order.
`.dots` | Used to work around non-standard evaluation. See `vignette("nse")` for details.

### Value

An object of the same class as `.data`.

Data frame row names are silently dropped. To preserve, convert to an explicit variable.

### Locales

Note that for local data frames, the ordering is done in C++ code which does not have access to the local specific ordering usually done in R. This means that strings are ordered as if in the C locale.

### See Also

Other single.table.verbs: `filter`, `filter_`; `mutate`, `mutate_`, `transmute`, `transmute_`; `rename`, `rename_`, `select`, `select_`; `slice`, `slice_`; `summarise`, `summarise_`, `summarize`, `summarize_`

### Examples

    arrange(mtcars, cyl, disp)
    arrange(mtcars, desc(disp))

[Package dplyr version 0.4.3 Index]