Learn R Programming

BCA (version 0.9-2)

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

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.