View Issue Details

This issue affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
20673Bug reportsImport/Exportpublic2026-09-08 01:38
Reporterujtwrujtwr Assigned Toc_schmitz  
PrioritynoneSeverityblock 
Status assignedResolutionopen 
Summary20673: Variable names are corrupted when exporting responses in R format
Description

When exporting responses in R format using “R (syntax file)”, the variable names (column names) for options in single-choice, multiple-choice, and other question types appear to have been replaced with internal identifiers.

Previously, these names followed a format such as {Question Code}_{Option Code}. This change has broken all of our R analysis scripts that rely on the previous naming convention.

The downloaded R syntax file contains the following code:


LimeSurvey Field type: F

data[, 10] <- as.numeric(data[, 10])
attributes(data)$variable.labels[10] <- "[Option A] Question 01"
data[, 10] <- factor(data[, 10], levels=c(1,0),labels=c("Yes", "Not selected"))
names(data)[10] <- "Q01__S3289"

LimeSurvey Field type: F

data[, 11] <- as.numeric(data[, 11])
attributes(data)$variable.labels[11] <- "[Option B] Question 01"
data[, 11] <- factor(data[, 11], levels=c(1,0),labels=c("Yes", "Not selected"))
names(data)[11] <- "Q01__S3290"

LimeSurvey Field type: F

data[, 12] <- as.numeric(data[, 12])
attributes(data)$variable.labels[12] <- "[Option C] Question 01"
data[, 12] <- factor(data[, 12], levels=c(1,0),labels=c("Yes", "Not selected"))
names(data)[12] <- "Q01__S3291"
....

In statements that assign column names, such as names(data)[10] <- "Q01__S3289", the option identifier does not match the answer option code configured in the attached screenshot.

CSV and Excel exports appear to retain the original column names.

Steps To Reproduce

Steps to reproduce

  1. Create multiple-choice and single-choice questions.
  2. Add several answer options to each question.
  3. Activate the survey and submit some test responses.
  4. From the response export screen, download the R script for importing the data by selecting “R (syntax file)”.
  5. From the same screen, download the R data file.
  6. Run the R syntax file to import the data.

Expected result

The data is imported with column names in the format {Question Code}_{Option Code}.

Actual result

The column names appear to be unpredictable internal identifiers.

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)LimeSurvey Community Edition Version 7.0.14+260904
I will donate to the project if issue is resolvedYes
Story point estimate0
Browserfirefox / chrome
Database type & versionmysql 8.0.45
Server OS (if known)Linux
Webserver software & version (if known)Apache 2.4
PHP Version8.3.29

Users monitoring this issue

There are no users monitoring this issue.

Activities

ujtwrujtwr

ujtwrujtwr

2026-09-07 03:34

reporter   ~85588

Example of the question settings screen

fig01.png (49,972 bytes)   
fig01.png (49,972 bytes)   
c_schmitz

c_schmitz

2026-09-07 09:29

administrator   ~85592

Please report if the attached file fixes the issue.

export_helper.php (153,500 bytes)
ujtwrujtwr

ujtwrujtwr

2026-09-08 01:38

reporter   ~85603

Thank you for your quick response.

After replacing export_helper.php, it appears to be working correctly.

Issue History

Date Modified Username Field Change
2026-09-07 03:33 ujtwrujtwr New Issue
2026-09-07 03:34 ujtwrujtwr Note Added: 85588
2026-09-07 03:34 ujtwrujtwr File Added: fig01.png
2026-09-07 03:34 ujtwrujtwr Bug heat 0 => 2
2026-09-07 09:28 c_schmitz Assigned To => c_schmitz
2026-09-07 09:28 c_schmitz Status new => assigned
2026-09-07 09:29 c_schmitz Note Added: 85592
2026-09-07 09:29 c_schmitz File Added: export_helper.php
2026-09-07 09:29 c_schmitz Bug heat 2 => 4
2026-09-07 09:29 c_schmitz Status assigned => feedback
2026-09-08 01:38 ujtwrujtwr Note Added: 85603
2026-09-08 01:38 ujtwrujtwr Status feedback => assigned