I have a character variable with an unknown number of levels. The levels have long text names and I'd like to recode them into something shorter, such as just 1, 2, 3, etc...
I understand how to use Match to recode a given set of levels to other specific values, but would like to ask how to do this if the initial set is unknown. That is, for each new data file the variable to recoded may have a different number of different entries.
Thanks!