desc: Descending order

Description Usage Arguments Value Examples

View source: R/desc.R

Description

Transform a vector into a format that will be sorted in descending order. This is useful within arrange().

Usage

1
desc(x)

Arguments

x

A vector to transform.

Value

A vector of the same length as x.

Examples

1
2
3
4
5
6
7
desc(1:10)
desc(factor(letters))

first_day <- seq(as.Date("1910/1/1"), as.Date("1920/1/1"), "years")
desc(first_day)

mtcars %>% arrange(desc(mpg))

poorman documentation built on March 28, 2021, 5:05 p.m.