Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Serious error in LimeSurvey generated R syntax

More
6 years 1 month ago #165021 by umor
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 following user(s) said Thank You: morissette697
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 1 month ago #165028 by DenisChenu
Replied by DenisChenu on topic Serious error in LimeSurvey generated R syntax

Version 2.06+ Build 151109

You use a more than 2 years old version … update at minimum to the last lts version …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
6 years 1 month ago #165032 by umor
Hello DenisChenu,

thank you for your reply. Unfortunately updating LimeSurvey on the server I am using is not in my hands.

At least the error is now documented for those who use older version or in case the error does also ocure in current versions.

Best regards, Ulrich
The topic has been locked.
More
6 years 1 month ago #165033 by jelo

umor wrote: Who should be informed about this issue?

Open a bugticket via bugtracker. After that post the link to that ticket here in the thread. There are not many topics around R. I'm not sure if some of the developers are regular R user.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 1 month ago - 6 years 1 month ago #165043 by holch
But what should the bug report say? Please fix an issue in a version that is not even the latest one in that branch and hasn't received any support for a long time?


And afaik you can only choose version 3 in the bug report.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 6 years 1 month ago by holch.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 1 month ago #165189 by DenisChenu
Replied by DenisChenu on topic Serious error in LimeSurvey generated R syntax
R export are totally rewrite in 3.0 , if previous version have issue, i 'm not sure it was fixed.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
6 years 1 month ago #165251 by umor
Dear holch, dear DenisChendu,

you are certainly right, I need to test if the issue is still there in the most recent LimeSurvey version. I will test, once I get access to version 3.0. But it will take some time...
@DenisChendu: thank you for the note that the R export function was completely re-written.
The topic has been locked.
More
6 years 1 week ago #166872 by umor
I finally manged to get access to Limesurvey 3.4.4+180305. After generating a test survey, I realized to option to generate R syntax is gone, only SPSS is left.



Can the R syntax be generated by Limesurvey in a different way under version 3.4.4?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 1 week ago #166874 by tpartner
Replied by tpartner on topic Serious error in LimeSurvey generated R syntax
Configuration --> Plugin manager --> Export results to R


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
6 years 1 week ago #166875 by umor
Thank you 'tpartner' for the extraordinary quick help.

After installing the R syntax plugin I can now confirm:

The issue with the R syntax I observered under version 2.06 does not occur under version 3.4.4.

Many thanks to the person(s) who fixed this issue!
The following user(s) said Thank You: DenisChenu
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose