Last data update: 2014.03.03

R: Relabel Factor Levels
relabel.factorR Documentation

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.

Details

The number of new factor labels/levels must be less than the number of labels/levels than the original factor.

Value

A factor whose length is equal to the old factor.

Author(s)

Dan Putler

Results