clean_scale: Clean scale scores

Description Usage Arguments Author(s) Examples

View source: R/scales.R

Description

Takes vectors representing likert scales and cleans text descriptions. E.g. "10 Very happy" becomes "10", and the value is converted to numeric (without warning).

Usage

1

Arguments

var

A character vector (factor will be coerced).

Author(s)

Kristian D. Olsen

Examples

1
2
x <- clean_scale(c("1 Not happy", "10 Very happy", "11 Don't know"))
identical(x, c(1, 10, NA))

itsdalmo/reporttoolDT documentation built on May 18, 2019, 7:11 a.m.