Learn R Programming

tinylabels (version 0.2.5)

relevel.tiny_labelled: Reorder Levels of Labelled Factor

Description

The levels of a factor are re-ordered so that the level specified by ref is first and the others are moved down. This is a copy from relevel in the stats package, but preserves the label attribute and class tiny_labelled.

Usage

# S3 method for tiny_labelled
relevel(x, ref, ...)

Arguments

x

an unordered factor.

ref

the reference level, typically a string.

...

additional arguments for future methods.