Skip to content

Instantly share code, notes, and snippets.

@kjgarza
Created November 20, 2012 10:48
Show Gist options
  • Save kjgarza/4117234 to your computer and use it in GitHub Desktop.
Save kjgarza/4117234 to your computer and use it in GitHub Desktop.
R replace
df <- data.frame(
coun)
profession.code <- c(`0` = 0, "1"="mexico", Accountants=2, Veterinarians=3,
`Financial analysts`=4, Nurses=5)
df$profession.str <- names(profession.code)[match(df$coun, profession.code)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment