set_response_labels: Set response labels on exported LS result data

View source: R/setResponseLabels.R

set_response_labelsR Documentation

Set response labels on exported LS result data

Description

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.

Usage

set_response_labels(data, labels, plang, other = c("-oth-", NA))

Arguments

data

Data frame of LimeSurvey R result data

labels

Data frame extracted from LimeSurvey *.lss xml file. See extract_response_labels

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

Details

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.

Value

Data frame with value (answer) labels assigned to each variable (column).

See Also

extract_response_labels


jmueller17/LimeRLabel documentation built on May 2, 2023, 7:13 p.m.