Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_responses() returns multiple observations but only one variable #53

Open
wolass opened this issue May 10, 2019 · 3 comments
Open

get_responses() returns multiple observations but only one variable #53

wolass opened this issue May 10, 2019 · 3 comments

Comments

@wolass
Copy link

wolass commented May 10, 2019

Hi guys! Thanks for developing the package

I have encountered the following problem:
Whenever I download the responses I get all the entries but in a strange format where all the columns are combined into one.

I tried to circumvent this using direct call using call_limer, but it basically gives me raw data which if I push to base64_to_df - gives just the same results as using get_response.

This guy has the same issue - so at least I'm not alone:
https://stackoverflow.com/questions/51989013/trying-to-pull-down-data-in-r-from-limesurvey-its-failing-why

All the variables are squashed into one line with points as separators:
as :
q620.cortico_priorv5..q620.cortico_acute..q620.cortico_primcarev3..q620.cortico_centre..q620.cortico_no..q620.other_priorv5..q620.other_acute..q620.other_primcarev3..q620.other_centre..q620.other_no..q631autoinjbrandv7.q632autoinjnumberv7.q633autoinjdosisv7.qcommentv5
I have underscores in my variable names - could this be a problem?

This is my session info:

R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.10

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.8.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.8.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=de_DE.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=de_DE.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] limer_0.1

loaded via a namespace (and not attached):
[1] httr_1.4.0      compiler_3.5.1  R6_2.4.0        tools_3.5.1     base64enc_0.1-3 curl_3.3        yaml_2.2.0      jsonlite_1.6  
@s-bravo
Copy link

s-bravo commented Jun 13, 2020

Hi, did you solve this problem? I have the same problem with some installations of Limesurvey.

@wolass
Copy link
Author

wolass commented Jun 18, 2020

No I haven't .

@FrdVnW
Copy link

FrdVnW commented Aug 20, 2020

Hi there, I have the same issue. It seems linked to the version of Limesurvey (an old one here) : see this commit d7c0c3e#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.) :

raw_data <- call_limer(method = "export_responses", 
                       params = list(iSurveyID = survey.id, 
                                     sDocumentType = "csv", 
                                     sLanguageCode = "fr", 
                                     sCompletionStatus = "complete", 
                                     sHeadingType = "code", 
                                     sResponseType = "long"))

data <- base64_to_df(raw_data)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants