Rdocumentation
powered by
Learn R Programming
BCA (version 0.9-3)
relabel.factor: Relabel Factor Levels
Description
Relabel the levels of factors to provide more descriptive names and reduce the number of factor levels.
Usage
relabel.factor(x, new.labels, old.labels=levels(x))
Arguments
x
A factor.
new.labels
The new factor level labels.
old.labels
The old factor level labels.
Value
A factor whose length is equal to the old factor.
Details
The number of new factor labels/levels must be less than the number of labels/levels than the original factor.