ropensci / qualtRics

Download ⬇️ Qualtrics survey data directly into R!
https://docs.ropensci.org/qualtRics
Other
215 stars 70 forks source link

Error: Please check if you passed the right file path #75

Closed libbybenson3 closed 6 years ago

libbybenson3 commented 6 years ago

Hello, This is a tricky issue to report since I can't give a reproducible problem, but essentially, I'm trying to download data from an existing set of surveys that I've downloaded data from (using the qualtRics package) many times, and for whatever reason today a subset of them throw an error when I try to download them. Some are still able to be downloaded though, so it's not a global issue. The error I'm getting is:

Error: File 'insert file path here with survey name at the end' does not exist. Please check if you passed the right file path

I'm able to set my api key and root url just fine. Additionally I'm able to create this object: surveys <- getSurveys()

I've triple checked that the surveyID strings that I"m entering are correct, and here is the code I use to get the data:

df <- getSurvey(surveyID = "redacted survey id", verbose = FALSE, useLocalTime=TRUE, force_request = TRUE, uselabels)

I've also tried going into Qualtrics itself and downloading the data manually to see if it's a qualtrics issue. But it seems not because I could download the data just fine.

So, overall I'm stumped, and not sure whether it's a package problem, or some other problem, but figured I'd write a post here just in case :)

Thanks very much for your help, and please let me know if I can clarify anything. Libby

JasperHG90 commented 6 years ago

Hi Libby,

Thanks for your message.

getSurvey() downloads the survey and unzips it, which returns a file path (see code). This file path is passed to readSurvey(), which in turn calls a helper that checks if the file path actually points to a file (see code). That's where the error occurs.

Of course, it's strange that you get this error, since the file should exist. If unzipping the file did not work, then how would the function return a file path? The answer should lie in how this code handles your request. The code downloads the zipped survey (lines 369-396), and then unzips and returns it (lines 398-408).

Ideally, the function should throw an error if one of these steps fails. Somehow, it doesn't. It'd really help me if you'd agree to showing me this error by sharing your screen. Otherwise, it's nearly impossible to debug it at a distance.

Let me know what you think!

Jasper.

libbybenson3 commented 6 years ago

Hi Jasper,

I apologize I keep seemingly breaking the package - and it is also frustrating that I can't share a screen with you due to IRB limitations for these data.

I'm working with IT to solve the issue since it's only for a subset of surveys, and only apparently on my work computer (not personal laptop) that the issue is occurring. Will let you know if we find a fix.

In the meantime, I've also encountered another new error (again, no idea what prompted this - and this time, the error happens on both my work desktop and personal laptop), that I'm wondering if you've seen before (I paste in below).

It seems that even though I'm setting my registerOptions(useLables=FALSE), there are still issues with reading in multiple choice items. Any idea on how to fix?

And again, if not, I totally understand since it's hard to trouble shoot when I can't actually provide you with the reproducible problem to look at.

Thanks for any advice you might have, Libby

Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected

actual 1 1 NA value in level set 1 row 2 2 NA value in level set 1 col 3 3 NA value in level set 1 expected 4 4 NA value in level set 1 actual 5 5 NA value in level set 1 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 0 row 2 2 NA value in level set 0 col 3 3 NA value in level set 0 expected 4 4 NA value in level set 0 actual 5 5 NA value in level set 0 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 0 row 2 2 NA value in level set 0 col 3 3 NA value in level set 0 expected 4 4 NA value in level set 0 actual 5 5 NA value in level set 0 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 0 row 2 2 NA value in level set 0 col 3 3 NA value in level set 0 expected 4 4 NA value in level set 0 actual 5 5 NA value in level set 0 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 0 row 2 2 NA value in level set 1 col 3 3 NA value in level set 0 expected 4 4 NA value in level set 1 actual 5 5 NA value in level set 1 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 0 row 2 2 NA value in level set 0 col 3 3 NA value in level set 0 expected 4 4 NA value in level set 0 actual 5 5 NA value in level set 0 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 1 row 2 2 NA value in level set 0 col 3 3 NA value in level set 1 expected 4 4 NA value in level set 0 actual 5 5 NA value in level set 0 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 0 row 2 2 NA value in level set 0 col 3 3 NA value in level set 0 expected 4 4 NA value in level set 0 actual 5 5 NA value in level set 0 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 0 row 2 2 NA value in level set 1 col 3 3 NA value in level set 1 expected 4 4 NA value in level set 0 actual 5 5 NA value in level set 0 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 0 row 2 2 NA value in level set 1 col 3 3 NA value in level set 1 expected 4 4 NA value in level set 0 actual 5 5 NA value in level set 0 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 1 row 2 2 NA value in level set 1 col 3 3 NA value in level set 1 expected 4 4 NA value in level set 1 actual 5 5 NA value in level set 1 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 1 row 2 2 NA value in level set 1 col 3 3 NA value in level set 1 expected 4 4 NA value in level set 1 actual 5 5 NA value in level set 1 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 1 row 2 2 NA value in level set 0 col 3 3 NA value in level set 1 expected 4 4 NA value in level set 0 actual 5 5 NA value in level set 0 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 0 row 2 2 NA value in level set 0 col 3 3 NA value in level set 0 expected 4 4 NA value in level set 0 actual 5 5 NA value in level set 0 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 0 row 2 2 NA value in level set 0 col 3 3 NA value in level set 0 expected 4 4 NA value in level set 0 actual 5 5 NA value in level set 0 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 10 row 2 2 NA value in level set 9 col 3 3 NA value in level set 10 expected 4 4 NA value in level set 12 actual 5 5 NA value in level set 9 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] Warning: 70 parsing failures. row # A tibble: 5 x 4 col row col expected actual expected actual 1 1 NA value in level set 10 row 2 2 NA value in level set 10 col 3 3 NA value in level set 9 expected 4 4 NA value in level set 12 actual 5 5 NA value in level set 7 ... ................................. ... ....................................... ........ ........................................................................................................................................... ...... ................................................................. ... ................................................................. ... ......... [... truncated] On Fri, Apr 6, 2018 at 10:16 AM, Jasper Ginn wrote: > Hi Libby, > > Thanks for your message. > > getSurvey() downloads the survey and unzips it, which returns a file path > (see code > ). > This file path is passed to readSurvey(), which in turn calls a helper > that checks if the file path actually points to a file (see code > ). > That's where the error occurs. > > Of course, it's strange that you get this error, since the file *should* > exist. If unzipping the file did not work, then how would the function > return a file path? The answer should lie in how this code > > handles your request. The code downloads the zipped survey (lines 369-396), > and then unzips and returns it (lines 398-408). > > Ideally, the function should throw an error if one of these steps fails. > Somehow, it doesn't. It'd really help me if you'd agree to showing me this > error by sharing your screen. Otherwise, it's nearly impossible to debug it > at a distance. > > Let me know what you think! > > Jasper. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > , > or mute the thread > > . > -- Lizbeth Benson, M.S. Graduate Student President, We R: Penn State R Users' Group Quantitative Developmental Systems Methodology | https://quantdev.ssri.psu.edu/ Studio Lab | http://playingthearchive.com/ Department of Human Development and Family Studies The Pennsylvania State University
JasperHG90 commented 6 years ago

Hi Libby,

Thanks for getting back to me. As it happens, I was emailing with another user today who ran into the same problem (your original one). I asked him to remove special characters from his survey titles, which seems to have solved his issue.

Regarding the second issue: try passing registerOptions(useLabels = FALSE, convertVariables=FALSE), as I suspect that qualtRics is still trying to convert your variables even though it's not able to.

Please keep breaking the package :-).

Best,

Jasper.

libbybenson3 commented 6 years ago

Hi Jasper, I apologize for the delay in getting back to you - but your suggestion worked, and I am extremely grateful for the help, since your package is integral to a data processing scheme I've set up for a large grant :)

Thanks again!! Libby

On Fri, Apr 13, 2018 at 10:24 AM, Jasper Ginn notifications@github.com wrote:

Hi Libby,

Thanks for getting back to me. As it happens, I was emailing with another user today who ran into the same problem (your original one). I asked him to remove special characters from his survey titles, which seems to have solved his issue.

Regarding the second issue: try passing registerOptions(useLabels = FALSE, convertVariables=FALSE), as I suspect that qualtRics is still trying to convert your variables even though it's not able to.

Please keep breaking the package :-).

Best,

Jasper.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ropensci/qualtRics/issues/75#issuecomment-381151692, or mute the thread https://github.com/notifications/unsubscribe-auth/AihV6kYMkhq6HVmCV9MSjZYY8yxXjwZFks5toLUVgaJpZM4TJST5 .

-- Lizbeth Benson, M.S. Graduate Student President, We R: Penn State R Users' Group Quantitative Developmental Systems Methodology | https://quantdev.ssri.psu.edu/ Studio Lab | http://playingthearchive.com/ Department of Human Development and Family Studies The Pennsylvania State University

digitalhealthresearch commented 3 years ago

Just wanted to add a note that this error will be triggered if your Qualtrics project name contains characters that cannot be written into a file name (in my case, it was a colon).

juliasilge commented 3 years ago

Related to the open issue #195 where we are tracking the possibility of renaming the file