identify_choice_questions: Identifies all questions in a form that have choices.

Description Usage Arguments Value Examples

View source: R/identify_choice_questions.R

Description

The function also accounts for different languages when the lang argument is specified. In both cases the relevant question label and choice column is named the same to facilitate code progression.

Usage

1
2
3
4
5
6
identify_choice_questions(
  lang = NULL,
  df_schema_ext = NULL,
  choice_col = NULL,
  label_col = NULL
)

Arguments

lang

Character containing the name of the language that is to be examined, defaults to NULL.

df_schema_ext

Data frame that defines the schema of the from. Can be passed to the function to avoid downloading it multiple times. Optional, defaults to NULL.

choice_col

String specifying the choices column that is to be changed, defaults to NULL.

label_col

String specifying the labels column that is to be changed, defaults to NULL.

Value

List

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# 1. Without df_schema_ext
choice_questions <- identify_choice_questions(lang = 'english', choice_col = 'choices_english_(en)', label_col = 'label_english_(en)')

# 2. With df_schema_ext
# ruODK needs to be set up for this function to work
repvisforODK::setup_ruODK(svc = 'example/svc.svc', un = 'exampleusername', pw = 'examplepassword', tz = 'Europe/Berlin', verbose = TRUE)

df_schema <- ruODK::form_schema_ext()

choice_questions <- identify_choice_questions(lang = 'english', df_schema_ext = df_schema, choice_col = 'choices_english_(en)', label_col = 'label_english_(en)')

## End(Not run)

lucidviews/repvisForODK documentation built on Feb. 13, 2022, 9:50 p.m.