reorder_desc: Reorder a factor using desc from dplyr

Description Usage Arguments Value Examples

View source: R/reorder_desc.R

Description

This function allows you to reorder the levels of a factor in decreasing order. R defines decreasing order as decreasing alphabetical order when the levels of factors are strings.

Usage

1

Arguments

x

factor

Value

factor; gives reordered levels in decending alphabetical order

Examples

1
2
3
x <- factor(c("a", "b", "c", "d"))
levels(x)
levels(reorder_desc(x))

qiaoyuet/foofactors documentation built on May 29, 2019, 12:06 p.m.