factorize
updated 2016-12-28
assigns value labels to data frame
Especially useful in surveys with labelled values from Stata, SAS, or SPSS. Converts labelled numeric values like c(0, 1, 0, 0) to factor variables like (‘male’, ‘female’, ‘male’, ‘male’) based on the value labels in the original dataset.