Learn R Programming

kutils (version 0.93)

reverse: Reverse the levels in a factor

Description

simple literal reversal. No fancy checks on input. If there are valid levels named "Skip" or "DNP", they will be moved back to the end of the list.

Usage

reverse(x, eol = c("Skip", "DNP"))

Arguments

x
a factor variable
eol
values to be kept at the end of the list

Value

a new factor variable with reversed values