scale2list: Transform a scale into a readable list

Description Usage Arguments Details Value Examples

View source: R/qscales.R

Description

This function turns a scale in the form of A = 1, 5, 10R, 15r into a list which of

  1. the scale used

  2. the name of the scale

  3. the items to use for the scale (by position in data frame or questionnaire)

  4. the items that need to be recoded.

Usage

1

Arguments

scale

A description of a scale in the form of scale <- c(name = 1, 2, 3, 4r, 5). The scale is defined using =, the items by their position in the data frame or questionnaire (this should correspond!).

Details

Items that need to be recoded are indicated using an R or r behind the number of the item.

Value

Returns a list that list that contains four entries: The input used (original.scale), the derived name of the scale (name), the items that constitute the scale items, the items that need to be recoded (recode)

Examples

1
2
3
4
5
6
scales = c("E = 1r, 6, 11R, 16",
           "A = 2r, 7, 12r, 17r",
           "C = 3, 8r, 13, 18",
           "N = , 9r, 14, 19",
           "O = 4, 10RR, 15, 20 21")
scale2list(scales[1])

kthorstmann/quest documentation built on May 20, 2019, 7:05 p.m.