data = data.frame("sex" = c(1, 2, 2, 1, 1),
"Name" = c("John", "Dora","Dora", "John","John"))
list_codes_values = list(c("F", "M"),c(1,2))
ans <- get_value_from_codes(data, column = "sex", nrcode = NA,
list_codes_values)
Run the code above in your browser using DataLab