Serious error in LimeSurvey generated R syntax

More
11 months 1 week 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

Please Log in or Create an account to join the conversation.

More
11 months 1 week ago #165028 by DenisChenu

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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
11 months 1 week 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

Please Log in or Create an account to join the conversation.

More
11 months 1 week 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

Please Log in or Create an account to join the conversation.

More
11 months 1 week ago - 11 months 1 week 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Last edit: 11 months 1 week ago by holch.

Please Log in or Create an account to join the conversation.

More
11 months 1 week ago #165189 by DenisChenu
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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: LouisGac

Please Log in or Create an account to join the conversation.

More
11 months 1 week 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.

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks 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?

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #166874 by tpartner
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.
Attachments:
The following user(s) said Thank You: LouisGac

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks 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, LouisGac

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!