reverse.levels {likert}R Documentation

Reverse the levels of a factor.

Description

Reverse the levels of a factor.

Usage

reverse.levels(x)

Arguments

x

a factor or a data.frame of factors whose levels will be reverse coded.

Examples

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)))

[Package likert version 1.3.5 Index]