Displaying 1 result from an estimated 1 matches for "feducord".
2011 Jan 01
3
Retrieving Factors with Levels Ordered
...a factor with labels in the order I want, write the data as a text file, and then retrieve them, the factor levels are no longer in the proper order.
Here is what I do (I tried many variations):
# educ is a numeric vector with 1,001 observations.
# There is one NA
# Use educ to create a factor
feducord <- factor(educ, labels = c('Elem', 'Mid', 'HS',
+ 'Bus', 'Some', 'Col', 'Post'), ordered = T)
levels(feducord)
[1] "Elem" "Mid" "HS" "Bus" "Some" "Col" "Pos...