View source: R/setResponseLabels.R
set_response_labels | R Documentation |
LimeSurvey offers the option to export survey result data as an R data frame. Variable values are
stored as response codes. This function assigns value labels for each variable. Overall, for most variable types
this means to convert the corresponding column and its values to a factor
variable. Except for numberic,
date and different open text fields (short, middle and long), all LimeSurvey and hence question types are converted
to factor
. LimeSurvey response codes are converted to factor levels while LimeSurvey response texts are assigned
to the corresponding factor labels.
set_response_labels(data, labels, plang, other = c("-oth-", NA))
data |
Data frame of LimeSurvey R result data |
labels |
Data frame extracted from LimeSurvey *.lss xml file. See |
other |
vector of length two. First entry contains LS code used for "Other" entry in variable. Second entry NA will lookup label for given language code, or use English label as default. See details. |
lang |
char language code |
Answer labels that are "Other" with text field have their own variable names of the form "questioncode.other" and question type "!" (dropdown). to indicate that response option is "other" (text). which is stored in an additional variable. Default value by LS is "-oth-", but could be different.
Data frame with value (answer) labels assigned to each variable (column).
extract_response_labels
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.