2

I'm running a particular piece of code, as below:

library(limer)
library(dplyr)
library(reshape2)
library(tidyverse)

options(lime_api= "x")
options(lime_username = 'y')
options(lime_password = 'z')
get_session_key()

mydata <- get_responses(iSurveyID=313212, sLanguageCode= 'en',     sResponseType='short')

My other colleagues can run this and produce a data frame with various columns and rows, but somehow, despite having the same version of R (3.3.3) as them, I'm left with a single variable, such as:

2,2018-08-06 10:45:53,11,en,2018-08-06 10:45:40

What's going on? Help would be greatly appreciated!

L.TK
  • 33
  • 2
  • The output is strange. Seems like all the columns are joined together in a single string. Are you sure you have responses in that survey.? – Gabriel Aug 23 '18 at 16:58

1 Answers1

0

I have the same issue. It seems linked to the version of Limesurvey (an old one here) : see this commit https://github.com/cloudyr/limer/commit/d7c0c3ecf4e2393045711622589165e75c3b5f4d#diff-c913239c7e28d0566d870ec92da5855c One easy solution could be to redefine locally :

base64_to_df <- function(x) {
  raw_csv <- rawToChar(base64enc::base64decode(x))

  return(read.csv(textConnection(raw_csv), stringsAsFactors = FALSE, sep = ","))
}

Then (ex.with your data and ex.) :

raw_data <- call_limer(method = "export_responses", 
                       params = list(iSurveyID = 313212, 
                                     sLanguageCode = "en", 
                                     sResponseType = "short"))

mydata <- base64_to_df(raw_data)

https://github.com/cloudyr/limer/issues/53

FrdVnW
  • 36
  • 4