re_code {creditmodel} | R Documentation |
re_code
search for matches to argument pattern within each element of a character vector:re_code
re_code
search for matches to argument pattern within each element of a character vector:
re_code(x, codes)
x |
Variable to recode. |
codes |
A data.frame of original value & recode value |
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)