mr_recode {rimu}R Documentation

Relabel levels of multiple-response objects

Description

Relabel some or all of the levels of a multiple-response object. Two levels that are recoded to the same value will be combined.

Usage

mr_recode(x, ...)

Arguments

x

Object of class mr or ms

...

new names in the form new_name="old name".

Value

New object of class mr, ms

Examples

data(nzbirds)
nzbirds<-as.mr(nzbirds)
nzbirds
## recode to English names
mr_recode(nzbirds,morepork="ruru",stilt="kaki",waxeye="tauhou")

data(usethnicity)
race<-as.mr(usethnicity$Q5,"")
race<-mr_drop(race,c(" ","F","G","H"))
race <- mr_recode(race, AmIndian="A",Asian="B", Black="C", Pacific="D", White="E")
mtable(race)

[Package rimu version 0.6 Index]