recode.varmap: using a recode matrix (called a varmap), which has columns...

Description Usage Arguments Value Examples

Description

using a recode matrix (called a varmap), which has columns 'code' and 'value' (and perhaps others), rename a variable. this is a convenient wrapper around the car::recode function

Usage

1
recode.varmap(x, varmap, as.factor.result = TRUE, ...)

Arguments

x

the variable to recode

varmap

a data.frame describing the recodes, which has columns called 'code' and 'value'

as.factor.result

if TRUE, turn the result into a factor

...

additional arguments to pass to car::recode

Value

the recoded variable

Examples

1
2
3
4
## Not run: 
  ## TODO -- write example

## End(Not run)

dfeehan/dhstools documentation built on May 15, 2019, 5:12 a.m.