desc: Descending order.

Description Usage Arguments Examples

View source: R/arrange.r

Description

Transform a vector into a format that will be sorted in descending order.

Usage

1
desc(x)

Arguments

x

vector to transform

Examples

1
2
3
4
desc(1:10)
desc(factor(letters))
first_day <- seq(as.Date("1910/1/1"), as.Date("1920/1/1"), "years")
desc(first_day)

Example output

 [1]  -1  -2  -3  -4  -5  -6  -7  -8  -9 -10
 [1]  -1  -2  -3  -4  -5  -6  -7  -8  -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19
[20] -20 -21 -22 -23 -24 -25 -26
 [1] 21915 21550 21185 20819 20454 20089 19724 19358 18993 18628 18263

plyr documentation built on March 3, 2020, 5:07 p.m.

Related to desc in plyr...