translate_levels: Helper function: translate levels
Description
Translate existing levels of a factor into new levels.
Usage
translate_levels(x, translations)
Arguments
- x
a factor vector to be translated
- translations
a named list that specifies the translation: list(newlevel=c(oldlevel1,oldlevel2,etc))
.