This is sometimes useful when plotting a factor.

fct_rev(f)

Arguments

f

A factor (or character vector).

Examples

f <- factor(c("a", "b", "c")) fct_rev(f)
#> [1] a b c #> Levels: c b a