View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
04644 | Bug reports | Statistics | public | 2010-10-01 19:19 | 2010-10-13 16:22 |
Reporter | Assigned To | mdekker | |||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 1.90+ | ||||
Fixed in Version | 1.90+ | ||||
Summary | 04644: Errors in Export R syntax file | ||||
Description |
The "lastpage" field doesn't get exported in the .csv file. In the R syntax file, the column numbering doesn't keep proper track of this. So, in the second line of the R syntax file, the columns get numbered sequentially: names(data)=paste("V",1:dim(data)[2],sep="") But the remainder of the script works with the field names as supplied by the spss_fieldmap() function. This means the data and the syntax file gets out of step (notice the missing V15): data[,which(names(data)=="V14")]=as.character(data[,which(names(data)=="V14")]) The same error will recur for each hidden variable in the survey. The fix for this is to have an indexing variable, e.g. $i that gets incremented when the foreach loop outputs something, and to use this indexing variable to refer to the columns.
This possibly works fine when calling source(), but when loading into an editor, the line gets truncated. The solution to this is to add a \n line break character between each column name.
The solution to this is to use a combination of addslashes() and iconv().
| ||||
Additional Information | I attach a rewritten file with my proposed corrections to export_data_r.php I have made substantial changes, the most important being to rewrite the logic to contain a single foreach loop. This has the side-effect of probably being more efficient, but the biggest reason is to ensure the incrementing of the $i variable is in only a single place. I hope this is of help. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | 9089 | ||||
I will donate to the project if issue is resolved | |||||
Browser | Firefox | ||||
Database type & version | MySql 5.0.90 | ||||
Server OS (if known) | Linux | ||||
Webserver software & version (if known) | Apache 1.3.42 | ||||
PHP Version | 5.2.9 | ||||
Menno, can you please check if this looks okay and if the review comes out ok please commit it? |
|
Note: Ignore point 3 above. I traced the encoding problems to my survey data. |
|
Patch looks good to me, tested on my local install and seems to work fine. Brought admin interface in line with spss export, giving the option to filter the response by completed, not completed or all. committed in Rev 9205 |
|
Released in latest Plus version |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2010-10-01 19:19 |
|
New Issue | |
2010-10-01 19:19 |
|
File Added: export_data_r.php | |
2010-10-01 19:19 |
|
Issue Monitored: user9189 | |
2010-10-04 21:18 | c_schmitz | Assigned To | => mdekker |
2010-10-04 21:18 | c_schmitz | Status | new => assigned |
2010-10-04 21:20 | c_schmitz | Note Added: 12989 | |
2010-10-04 23:05 |
|
Note Added: 12993 | |
2010-10-11 14:44 | mdekker | Note Added: 13066 | |
2010-10-11 14:44 | mdekker | Status | assigned => resolved |
2010-10-11 14:44 | mdekker | Fixed in Version | => 1.90+ |
2010-10-11 14:44 | mdekker | Resolution | open => fixed |
2010-10-13 16:22 | c_schmitz | Note Added: 13121 | |
2010-10-13 16:22 | c_schmitz | Status | resolved => closed |