In the Translated tables obtained from a database version, categorical variables have their responses stored as character strings. This is often fine, but sometimes there is an ordering of the levels that we may want to retain in modeling / visualization.
We can do this by returning categorical variables as factors. The natural choice of order of the levels is the ordering in the codebook. nhanes() should have an option to use this. However, care is needed in case some special levels are converted (to NA etc.).