re_code {creditmodel}R Documentation

re_code re_code search for matches to argument pattern within each element of a character vector:

Description

re_code re_code search for matches to argument pattern within each element of a character vector:

Usage

re_code(x, codes)

Arguments

x

Variable to recode.

codes

A data.frame of original value & recode value

Examples

SEX  = sample(c("F","M"),1000,replace = TRUE)
codes= data.frame(ori_value = c('F','M'), code = c(0,1) )
SEX_re = re_code(SEX,codes)

[Package creditmodel version 1.3.1 Index]