Description Usage Arguments Value Examples
Arrange rows via descending or ascending column values
1 | arrange_data(.data, ...)
|
.data |
data frame |
... |
One or more unquoted names of columns on which to arrange the rows. If none
are supplied, the data are returned as is. By default, ordering is done in ascending
order. To orer in descending order, use |
Rearranged data frame
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## data frame to arrange
dat <- data.frame(
a = c(rep("a", 3), rep("b", 3), rep("c", 4)),
b = c( 3, 3, 2, 8, 8, 1, 5, 5, 5, 9),
c = c(-1, 0, 0, -5, 0, 2, -2, -4, 1, 0),
stringsAsFactors = FALSE
)
## arrange by one column
arrange_data(dat, a)
## arrange by multiple columns
arrange_data(dat, decr(a), b, c)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.