Description Usage Arguments Details Value See Also Examples
View source: R/closure_defaults.R
Uses a loaded kobo questionnaire to get the labels of select_one and select_multiple type questions.
1 | question_get_choice_labels(responses, variable.name)
|
responses |
A vector of responses in kobo xml name format |
variable.name |
The xml name of a kobo question. (as it appears in the kobo questionnaire and subsequently in the data column headers) Should be a question of type 'select_one' or 'select_multiple'. |
To use this you must first successfully run load_questionnaire
.
If conversion of a value in responses
fails, the original input value is returned. This happens in the following cases:
No questionnaire has been loaded with load_questionnaire
variable.name
could not be found in the questionnaire, or in the data that was supplied to load_questionnaire
A value in responses
is not listed in the loaded questionnaire
variable.name
is not listed as a question of type 'select_one' or 'select_multiple' in the questionnaire.
This does not work for concatenated responses of 'select_multiple' questions (e.g. strings of the form "choice_a choice_b"); The responses
should have only a single response per element.
A vector of strings with labels corresponding to the choices supplied in responses
.
load_questionnaire
must be run first. The equivalent of this but for question labels is question_get_question_label
,
1 | question_get_choice_labels(mydata$location, "location")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.