relabel {memisc}R Documentation

Change Labels of factors or of any labeled object

Description

This function changes the labels of a factor of any object that has a names, labels, value.labels, or variable.labels attribute.

Usage

## Default S3 method:
relabel(x,...)
## S3 method for class 'factor':
relabel(x,...)

Arguments

x An object with a names, labels, value.labels, or variable.labels attribute
... A sequence of named arguments, all of type character

Details

This function changes the names or labels of x according to the remaining arguments. The argument names are the old names, the values are the new names.

Value

The object x with new labels defined by the ... arguments.

Examples

  f <- as.factor(rep(letters[1:4],5))
  print(f)
  relabel(f,
    a="A",
    b="B",
    c="C",
    d="D"
    )

[Package memisc version 0.11-10 Index]