lrecode: Recode variables (create new variables).

Description Usage Arguments Details Value Examples

View source: R/lrecode.R

Description

Recode variables.

Usage

1
lrecode(dat, var, newvar, old, new)

Arguments

dat

Datatable object.

var

Character or vector of characters with variable names.

newvar

Character or vector of characters with new variable names.

old

Old values.

new

New values (1 to 1 recoding).

Details

Avoid define the first value as missing, put missing values at the end of the old/new specification

Value

Data frame with recoded variables.

Examples

1
lrecode(dat, c("var1", "var2"), c("nvar1", "nvar2"), c(1,2,3,4), c(4,3,2,1))

sdaza/sdazar documentation built on May 29, 2019, 4:20 p.m.