Skip to contents

Reverses the order of the levels of a factor.

Usage

util_rev_fac(f)

Arguments

f

A factor

Value

Factor f with reversed order of the levels

Details

Replacement for forcats::fct_rev(), in order to reduce the number of dependencies to datscience package

Author

Björn Büdenbender

Examples

if (FALSE) {
if (interactive()) {
  f <- factor(letters[c(1:5)])
  (reversed_factor <- util_rev_fac(f))
}
}