method-recode: Perform a recoding of a categorical variable

Description Usage Arguments Details Value Methods Author(s) See Also Examples

Description

recode performs a recoding of an object inheriting of a CategoricalVariable object.

Usage

1
recode(object, ...)

Arguments

object

an object inheriting of the class CategoricalVariable

...

Enter each new value as an option name, and for each element give a vector specifying the old values to be merged to create the new value. If a vector of old values is numeric the function expects codes, and if character the function expects short value labels.

Details

A cross table is printed to allow the user checking the recoding performed correctly.

Value

A CategoricalVariable with the new coding scheme.

Methods

signature(object = "CategoricalVariable")

recode method for a CategoricalVariable object.

Author(s)

Emmanuel Rousseaux

See Also

cut

Examples

1
2
3
4
5
6
7
8
data(dds)
valids(dds$connaissetcomp.acquis.1)
dds$connaissetcomp.acquis.1.in3 <- recode(
  dds$connaissetcomp.acquis.1,
  'no' = 1:2,
  'average' = 3,
  'yes' = 4:5
)

Dataset documentation built on May 2, 2019, 6:09 p.m.