powered by
destring(x)
safe.chars
mylevels <- c('Strongly Disagree', 'Disagree', 'Neither', 'Agree', 'Strongly Agree') myvar <- factor(sample(mylevels[1:5], 10, replace=TRUE)) unclass(myvar) # testing order destring(myvar)
Run the code above in your browser using DataLab