View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
06894Bug reportsImport/Exportpublic2013-02-07 10:52
Reporterdholeman Assigned Touser9189 
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.00+ 
Fixed in Version2.00+ 
Summary06894: Data export in R syntax file for ranking type questions omits answer labels causing R data import failure
Description

Answer data from ranking type questions that are exported in R format (.csv and .R files) cannot be imported into R via either the command line or R Commander.

Importing into R via R Commander causes a generic error message and the survey data fails to load.

Importing into R via the command line interface [i.e. source("survey_546891_R_syntax_file.R", encoding = "UTF-8")] allows the survey to be imported properly except for ranking type questions which have empty data. Each answer for ranking type questions causes the following error message:

"Warning in levels<-(*tmp*, value = if (nl == nL) as.character(labels) else paste0(labels, duplicated levels will not be allowed in factors anymore"

The cause of the import error is that the answer labels are missing for the ranking type questions in the R Syntax (.R) file output. For instance:

data[, 68] <- as.character(data[, 68])
attributes(data)$variable.labels[68] <- "[Rank 1] Which of these are most important when you buy a rose bush at a nursery or independent garden center?"
data[, 68] <- factor(data[, 68], levels=c("A1","A2","A7","A3","A8","A4","A5","A6"),labels=c("","","","","","","",""))
names(data)[68] <- "ranking_1_1"

The data itself is present in the companion .csv file.

I can replace the labels with data manually and then import the answer successfully to R. This is a problem with the output algorithm from Limesurvey rather than an input problem with R.

I used R Commander V.1.9-1 from http://www.r-project.org, http://socserv.socsci.mcmaster.ca/jfox/Misc/Rcmdr/

and R version 2.15.1

Steps To Reproduce

Create a survey with a ranking questions (see attached lss).
Execute the survey to generate answers to the question.
Export the answers in R format.
Import the answers to R.
Examine the R syntax file to discover missing labels.

TagsNo tags attached.
Attached Files
Bug heat6
Complete LimeSurvey version number (& build)121117
I will donate to the project if issue is resolvedNo
BrowserFirefox
Database type & version5.0.96 MySQL
Server OS (if known)Linux kernel 2.6.18-374.el5.lve0.
Webserver software & version (if known)Apache 2.2.21
PHP Version5.2.17

Users monitoring this issue

mikeg

Activities

c_schmitz

c_schmitz

2012-11-18 14:27

administrator   ~22301

Hey Andrie, can you please take a look at this?

mikeg

mikeg

2013-01-29 01:24

reporter   ~23859

I'm a limeservice user and I just upgraded to 2.0 which I now regret because I'm having this same problem. It's frustrating because I had just gotten everything working with my scripts to process the surveys and then I upgraded. Ugh.

c_schmitz

c_schmitz

2013-02-07 10:52

administrator   ~23969

New version 2.00 build 120206 released.

Related Changesets

LimeSurvey: master 88f500d2

2013-01-29 14:59:40

andrie

Details Diff
Fixed issue 06894: Data export in R syntax file for ranking type questions omits answer labels causing R data import failure
Dev export.php In function exportr() set $length_vallabel to 120, to prevent blank answer field
Fixed issue 07243: Syntax error in sytax file for R
Dev export.php In function exportr() changed read.csv() arguments
Affected Issues
06894, 07243
mod - .gitignore Diff File
mod - application/controllers/admin/export.php Diff File

Issue History

Date Modified Username Field Change
2012-11-18 09:43 dholeman New Issue
2012-11-18 09:43 dholeman File Added: limesurvey_survey_546891.lss
2012-11-18 14:26 c_schmitz Assigned To => user9189
2012-11-18 14:26 c_schmitz Status new => assigned
2012-11-18 14:27 c_schmitz Note Added: 22301
2013-01-29 01:24 mikeg Note Added: 23859
2013-01-29 01:26 mikeg Issue Monitored: mikeg
2013-01-29 16:05 c_schmitz Changeset attached => LimeSurvey master 88f500d2
2013-01-29 16:05 c_schmitz Status assigned => resolved
2013-01-29 16:05 c_schmitz Fixed in Version => 2.00+
2013-01-29 16:05 c_schmitz Resolution open => fixed
2013-02-07 10:52 c_schmitz Note Added: 23969
2013-02-07 10:52 c_schmitz Status resolved => closed
2021-08-03 07:41 guest Bug heat 4 => 6