Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
13942Bug reportsImport/Exportpublic2020-03-09 15:36
Reportericeclimber81 Assigned Toc_schmitz  
Status closedResolutionfixed 
Product Version3.13.x 
Fixed in Version3.17.x 
Summary13942: R syntax file export appends 'unknown type' line to the end of the syntax file

When exporting survey results and selecting 'R (syntax file)' as the format, the last line of code of the .R file that gets exported reads 'Unknown type' and produces an error when sourcing the file in R.

Steps To Reproduce

Admin > Responses & statistics > Export responses > Select 'R (syntax file)' with the following options:

  • Completed responses only
  • Export questions as: question code and question text
  • Export responses as: Answer codes
  • Convert Y to: 1, convert N to: 0
    Click 'Export'
TagsNo tags attached.
Complete LimeSurvey version number (& build)Version 3.13.2, Build 180709
I will donate to the project if issue is resolvedNo
BrowserGoogle Chrome Version 67.0.3396.99
Database & DB-Versionmysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $
Server OS (if known)Linux dd6928 4.4.0-130-generic #156-Ubuntu SMP Thu Jun 14 08:53:28 UTC 2018 x86_64
Webserver software & version (if known)Apache
PHP Version7.0.30-nmm1


has duplicate 14986 closedcdorin spss export fails on unrecognized or invalid variable format. (error 2265) 




2019-02-06 13:00

manager   ~50426

Testing it now. Will provide more details soon.



2019-02-08 14:36

reporter   ~50462

I cannot reproduce the issue in version 3,15 with mariadb and php71



2019-02-08 15:11

manager   ~50465

Didn't have time to check all the questions. As far as I remember, I had this Unknown type error when timings was enabled (survey format question by question) + some questions (e.g., text display) were included in the survey.



2019-02-08 15:12

reporter   ~50466

I've just tried it again with the latest version 3.15.8 and mysql 5.0.12 and the issue persists (see attached screenshot of the .R syntax file that is produced)



2019-02-08 15:14

reporter   ~50467

@cdorin ( I have timings enabled and a wide variety of questions (multiple choice, ranking, free text, etc)



2019-02-08 18:50

manager   ~50474

thank you @icecliber81 for your confirmation. Did some tests. The "Unknown type" error appears when save timings is enabled. The timings can be imported in R in LimeSurvey 2.73. But not LS 3.15.8. . In LS 3.15, the data gets exported in the data file, but the syntax file cannot read the timings since there is no command for such a thing (hence, the error type). I have also attached my .lsa files for LS 2.73 and LS 3.15.

Extra: saw that "seed" is now being imported in LS 3.15.8 while seed was not imported in 2.73 (see screenshot)

Test_R - LS 3.15.8.lsa (4,186 bytes)
Selection_731.png (303,911 bytes)
Test_R - LS 2.73.lsa (3,511 bytes)


2019-02-12 17:20

reporter   ~50527

@cdorin, so will there be a solution in LS (like automatically disabling timing export when exporting to R) or is the only way around this disabling timings in the LS survey?



2019-02-12 17:45

manager   ~50534

Last edited: 2019-02-12 17:47

View 2 revisions

@iceclimber81, we are working on a fix now since we already have a couple of users who have already reported this issue. Unfortunately, I cannot provide any ETA. You can wait for the solution or try a different workaround. Please note that even if you disable the timings, they are already stored in the response table. Therefore, the error will still be shown. A customized script is needed to import your .csv file from LimeSurvey into R.

My comment is more like a warning sign for those that export their data to R and use Save timings. We hope to solve this asap.



2019-04-17 18:04

manager   ~51504

@f_funke, this is the R bug we were talking about.



2019-06-03 17:03

administrator   ~52276

Fix committed to master branch:

Related Changesets

LimeSurvey: master 41b3b0d3

2019-06-03 17:01:25


Details Diff
Fixed issue 13942: R syntax file export appends 'unknown type' line to the end of the syntax file when timings are activated Affected Issues
mod - application/core/plugins/ExportR/RSyntaxWriter.php Diff File

Issue History

Date Modified Username Field Change
2018-08-07 15:02 iceclimber81 New Issue
2019-02-06 13:00 cdorin Note Added: 50426
2019-02-08 14:36 ritapas Note Added: 50462
2019-02-08 15:11 cdorin Note Added: 50465
2019-02-08 15:12 iceclimber81 File Added: Screenshot 2019-02-08 at 15.11.12.png
2019-02-08 15:12 iceclimber81 Note Added: 50466
2019-02-08 15:14 iceclimber81 Note Added: 50467
2019-02-08 18:50 cdorin File Added: Test_R - LS 3.15.8.lsa
2019-02-08 18:50 cdorin File Added: Selection_731.png
2019-02-08 18:50 cdorin File Added: Test_R - LS 2.73.lsa
2019-02-08 18:50 cdorin Note Added: 50474
2019-02-08 18:51 cdorin Assigned To => LouisGac
2019-02-08 18:51 cdorin Status new => assigned
2019-02-11 10:49 cdorin Priority none => normal
2019-02-12 17:20 iceclimber81 Note Added: 50527
2019-02-12 17:45 cdorin Note Added: 50534
2019-02-12 17:45 cdorin Priority normal => high
2019-02-12 17:47 cdorin Note Edited: 50534 View Revisions
2019-04-17 18:04 cdorin Note Added: 51504
2019-06-03 17:03 c_schmitz Changeset attached => LimeSurvey master 41b3b0d3
2019-06-03 17:03 c_schmitz Note Added: 52276
2019-06-03 17:03 c_schmitz Assigned To LouisGac => c_schmitz
2019-06-03 17:03 c_schmitz Resolution open => fixed
2019-06-03 17:05 c_schmitz Status assigned => resolved
2019-06-03 17:05 c_schmitz Fixed in Version => 3.17.x
2019-06-18 07:33 DenisChenu Relationship added has duplicate 14986
2020-03-09 15:36 c_schmitz Status resolved => closed