Reorder Levels of 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 useful for
contr.treatment
contrasts which take the first level as the reference.
USAGE:
relevel(x, ref, ...)
REQUIRED ARGUMENTS:
x
An unordered factor.
ref
The reference level, as a string or a number.
OPTIONAL ARGUMENTS:
...
Additional arguments for future methods.
VALUE:
A factor of the same length as
x
.
SEE ALSO:
,