View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|09392||Bug reports||Import/Export||public||2014-12-08 15:55||2015-05-20 11:11|
|Fixed in Version||2.05+|
|Summary||09392: R-Export writes R syntax file which incorrectly interprets optional binary responses|
|Description||Using the R-export function produces an R script which does not correctly interpret optional binary responses. It appears to make no difference whether you make use of 'answer codes' or 'full answers' in the export.|
In the R data file export (example.csv), row 16 has a value of '1' and row 17 has a value of '2'. In the CSV export (example-spreadsheet.csv) it can be seen that the corresponding values are 'no' and 'yes' (rows 17 and 18 due to the header). The R syntax file (example.R), however, incorrectly describes how '1' and '2' should be interpreted, treating all numeric values as 'yes'. After importing the file I see:
1 Yes 171
2 <NA> 116
 Yes Yes
Levels: Yes Not selected
The flaw in the R syntax file is pretty obvious and easy to correct, once you are aware of the issue. So hopefully it is a simple matter to fix the R-export function to output a correct R script.
|Steps To Reproduce||1. Create a survey with an optional question with 'yes' and 'no' as options.|
2. Fill in the survey three times, once with 'yes', once with 'no' and once without answering the question.
3. Export the R data file and R syntax file using R-export.
4. Import the R syntax file in R.
The result will be two 'yes' answers and one 'N/A' answer.
|Additional Information||The attached data files are the export of the responses to a single question in an actual survey. The title of the question has been changed. The R syntax file has been changed to point to 'example.csv' instead of the automatically assigned survey number.|
|Tags||No tags attached.|
|Complete LimeSurvey version number (& build)||140320|
|I will donate to the project if issue is resolved||No|
|Database & DB-Version||MySQL Server version: 5.1.73-1|
|Server OS (if known)||Debian 6.0.10|
|Webserver software & version (if known)||Apache 2.2.22-13+deb7u3 (amd64)|
|PHP Version||php (libapache2-mod-php5) 5.4.4-14+deb7u14|
example.tgz (1,463 bytes)
|Can you please attach the sample survey, too? Thank you!|
self-contained_example.tgz (3,255 bytes)
example.tgz contains a subset of data exported from a real survey. The survey which created these results cannot be shared. I have therefore created an example survey to demonstrate the issue.
self-contained_example.tgz contains a survey that I created to demonstrate this issue. It contains the survey structure export (.lss), a CSV export of the data I entered (-spreadsheet.csv), the R syntax export (.R) and the R data export (.csv).
The CSV export shows the data as it was actually entered:
In the R export this becomes:
And in the R syntax file, '1' is 'Yes' and '2' is 'No'.
|Version 2.05+ Build 150520 released.|
|2014-12-08 15:55||abarcomb||New Issue|
|2014-12-08 15:55||abarcomb||File Added: example.tgz|
|2014-12-09 13:54||c_schmitz||Note Added: 31204|
|2014-12-09 13:54||c_schmitz||Assigned To||=> c_schmitz|
|2014-12-09 13:54||c_schmitz||Status||new => feedback|
|2014-12-09 14:15||abarcomb||File Added: self-contained_example.tgz|
|2014-12-09 14:21||abarcomb||Note Added: 31214|
|2014-12-09 14:21||abarcomb||Status||feedback => assigned|
|2015-05-08 12:29||c_schmitz||Changeset attached||=> LimeSurvey master 8d25f5ea|
|2015-05-08 12:29||c_schmitz||Status||assigned => resolved|
|2015-05-08 12:29||c_schmitz||Fixed in Version||=> 2.05+|
|2015-05-08 12:29||c_schmitz||Resolution||open => fixed|
|2015-05-20 11:11||c_schmitz||Note Added: 32249|
|2015-05-20 11:11||c_schmitz||Status||resolved => closed|