Dear LimeSurvey developers,
thank you for providing this incredible useful software.
With pleasure I saw it is even possible to download R syntax to easily import survey data into R. What a wonderful idea!
Using a German installation of LimeSurvey (Version 2.06+ Build 151109) I realized there is an error in the generated R code which does not lead to an error message but to wrong results. It occurs with multiple choice questions. See below an example from the LimeSurvey-generated R-code:
##########################
# LimeSurvey Field type: F
data[, 26] <- as.numeric(data[, 26])
attributes(data)$variable.labels[26] <- "Question text"
data[, 26] <- factor(data[, 26], levels=c(1,0), labels=c("Ja", "Nicht Gewählt"))
names(data)[26] <- "QuestionCode"
############################
The problem is that, at least in my case, the function "as.numerical()" generates values 1 and 2 and later in "factor()" it is assumed that there are values 1 and 0. This results in saving "No" as "Yes" and "Yes" as Not available (NA).
The correct command would be:
data[, 26] <- factor(data[, 26], levels=c(2,1), labels=c("Ja", "Nicht Gewählt"))
Has this been reported before? Is this a German Limes-Survey R-interaction specific issue or does it occur in other languages as well?
Who should be informed about this issue?
Thank you, Ulrich
The topic has been locked.