I must have a misunderstanding of what the
unclass() command does. I thought it worked on categorical columns that were composed from a small list of choices. R, being efficient, doesn't store character strings over and over again, but rather stored a number that is keyed to the strings.
My example is a theoretical candies sample, with 250 candies from a plain M&Ms package and the same number from a generic Brand X package. You can get this 500-row data table here.
The two columns are Color and Type, both categorical, and I've executed
as.factor() commands on both. Yet when I try
unclass(Candies$Color), I get a list of 500 strings. I assumed I'd get 500 numbers and a list of levels.