question.single: Define a single-choice question.

Description Usage Arguments See Also

View source: R/question.R

Description

question.single returns a question definition that displays responses as radio-buttons or as a combo-box, allowing for the selection of at most one response.

Usage

1
2
question.single(id, label, responses, required = TRUE, use.select = FALSE,
  inline = FALSE, width = NULL, placeholder = NULL)

Arguments

id

(character) the unique identifier of the question; it will be used as the column name in the data.frame returning the questionnaire data and when prefixed with 'question' - as the inputId for the input slot.

label

(character) the text displayed as the header of the question.

responses

(response list) the response list giving the identifiers and labels of all responses (e.g. as returned by buildResponses).

required

(logical) if FALSE, the respondent is free to not choose a response; if TRUE, the respondent must select a response before moving on to subsequent pages of the questionnaire.

use.select

(logical) if FALSE, displays radio-buttons; if TRUE, displays a combo-box with all responses available through the drop-down list.

inline

(logical) if FALSE, radio-buttons will be displayed vertically; if TRUE, controls will be displayed horizontally. If use.select == TRUE, this argument will be ignored.

width

(character) the width of the input, e.g. '400px' or '100%'.

placeholder

(character) the text that will be displayed in the combo-box when there are no responses selected yet; defaults to "Click to select a response". If use.select == FALSE, this argument will be ignored.

See Also

buildResponses, checkboxGroupInput, radioButtons, selectInput.

Other question definitions: question.mixed, question.multiple, question.numeric, question.text


mtrybulec/interviewer documentation built on May 23, 2019, 8:20 a.m.