likert_switch: Inverting Likert Scale Answers for reverse items

View source: R/likert_switch.R

likert_switchR Documentation

Inverting Likert Scale Answers for reverse items

Description

As some items in Likert scale questionnaires are inversted, it is necessary to invert them to combine the results from a particular item with the others. This function does exactly that.

Usage

likert_switch(
  data, 
  name,
  chr = FALSE,
  n,
  qoi,
  export = TRUE)

Arguments

data

a data frame with individual participants in rows and different measures in columns.

name

name of the analysis to specify the output file.

chr

if the items in the data frame are characters instead of numerical entries, set chr to TRUE

n

number of sclae items. Default = 5.

qoi

Question or item of interest in a dataset with many different rows. Default = 1.

export

TRUE if a CSV file with the modified data should be exported, FALSE if not.

Examples

# If you want to invert the third column that is on a 5-point Likert scale
likert_switch(data, name = "Item3_REV", n = 5, qoi = c(3), export = TRUE)

samueltobler/behavdata documentation built on July 9, 2024, 11:33 a.m.