update_question: Update attributes of a question

Description Usage Arguments Details Examples

View source: R/update_question.R

Description

Versatile function to change the behavior of a question and the survey.

Usage

1
update_question(qsf, id_name, id, ...)

Arguments

qsf

qsf file as R list

id_name

which question ID to use: "PrimaryAttribute" or "SecondaryAttribute"?

id

Value of id_name.

...

key-value tuples (see details)

Details

The list below catalogs some of common keys that control the behavior of a question. The function accepts all key-value tuples.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(svy_qsf)

# Change data export tag 
qsf <- update_question(qsf, 
	id_name='SecondaryAttribute', 
	id='sex', 
	DataExportTag='gender')

# Convert to multiple choice 
qsf <- update_question(qsf, 
	id_name='SecondaryAttribute', 
	id='sex', 
	Selector='MAVR',
	SubSelector='TX')

# Forced choice for both questions 
qsf_mod <- update_question(svy_qsf, 
 id_name='SecondaryAttribute', 
 id=c('sex', 'born'), 
 Validation=construct_validation(type='force'))

sumtxt/qsf documentation built on Nov. 22, 2021, 9:31 p.m.