- Posts: 5
- Thank you received: 3
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Serious error in LimeSurvey generated R syntax
- umor
- Topic Author
- Offline
- New Member
Less
More
6 years 1 month ago #165021
by umor
Serious error in LimeSurvey generated R syntax was created 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
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13676
- Thank you received: 2496
6 years 1 month ago #165028
by DenisChenu
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.
Replied by DenisChenu on topic Serious error in LimeSurvey generated R syntax
You use a more than 2 years old version … update at minimum to the last lts version …Version 2.06+ Build 151109
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.
- umor
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 3
6 years 1 month ago #165032
by umor
Replied by umor on topic Serious error in LimeSurvey generated R syntax
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
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.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
6 years 1 month ago #165033
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Serious error in LimeSurvey generated R syntax
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.umor wrote: Who should be informed about this issue?
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11681
- Thank you received: 2748
6 years 1 month ago - 6 years 1 month ago #165043
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Serious error in LimeSurvey generated R syntax
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.
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13676
- Thank you received: 2496
6 years 1 month ago #165189
by DenisChenu
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.
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.
- umor
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 3
6 years 1 month ago #165251
by umor
Replied by umor on topic Serious error in LimeSurvey generated R syntax
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.
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.
- umor
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 3
6 years 4 weeks ago #166872
by umor
Replied by umor on topic Serious error in LimeSurvey generated R syntax
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10115
- Thank you received: 3597
6 years 4 weeks ago #166874
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Serious error in LimeSurvey generated R syntax
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The topic has been locked.
- umor
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 3
6 years 4 weeks ago #166875
by umor
Replied by umor on topic Serious error in LimeSurvey generated R syntax
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!
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.