scalestrip: Strips Likert scale point labels, returns numeric or ordinal data
Description
Survey systems export responses to Likhert scales with the scale labels on, meaning that R
as factors or text as opposed to numeric data. This function takes labelled scales and returns unlabelled numeric data (by default), or an unlabelled ordered factor (if requested).
Usage
scalestrip(x, ordinal = FALSE)
Arguments
x
a vector
, matrix
, or data.frame
, containing Likert data labelled in the format "Integer - some text", e.g. "10 - Extremely Likely" ordinal
logical
(TRUE
\codeFALSE).
Should the data returned be an ordered factor? Otherwise the data returned is numeric
. Defaults to FALSE
.Value
Unlabelled numeric data (by defualt), or an unlabelled ordered factor (if requested).