question_variable_to_choice_text: Convert the Variable Response into its Corresponding Text

Description Usage Arguments Value

View source: R/results_generation.R

Description

This function looks up a choice's corresponding text by using the question[['Payload']][['Choice']] list, and if applicable, the question[['Payload']][['RecodeValues']] list as an intermediary lookup. Moreover, if a choice has a corresponding text entry component, this function attempts to identify which column corresponds to the text entry responses and modifies the returned choice text to include "See Appendix [Column DataExportTag]" where the [Column DataExportTag] is replaced by the column name of the corresponding text entry response column.

Usage

1
question_variable_to_choice_text(question, choice, use_recode_values)

Arguments

question

This is a list object representing an individual question from a Qualtrics Survey File. A question must have the 'Choices' list inside its 'Payload' in order to be accepted by this function. Furthermore, the choice provided must appear in the Choices list (or if use_recode_values is TRUE then the choice argument provided must appear among the RecodeValues list).

choice

A choice response to a question, given as a string or number.

use_recode_values

A logical boolean value indicating whether or not the RecodeValues list needs to be used as an intermediary step in looking up the text corresponding to the passed choice argument.

Value

The text corresponding to the variable choice indicated for the given question.


ctesta01/qualtrics-R-package documentation built on May 14, 2019, 12:28 p.m.