View source: R/reverse.levels.R
reverse.levels | R Documentation |
Reverse the levels of a factor.
reverse.levels(x)
x |
a factor or a data.frame of factors whose levels will be reverse coded. |
mylevels <- c('Strongly Disagree', 'Disagree', 'Neither', 'Agree', 'Strongly Agree')
test <- factor(sample(mylevels[1:5], 10, replace=TRUE))
cbind(test, as.integer(test), as.integer(reverse.levels(test)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.