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

"incomplete final line" in registerOptions in qualtRics 2.0 #37

Closed
rdrr1990 opened this issue Jun 28, 2017 · 4 comments
Closed

"incomplete final line" in registerOptions in qualtRics 2.0 #37

rdrr1990 opened this issue Jun 28, 2017 · 4 comments

Comments

@rdrr1990
Copy link

I've used qualtRics 1.0 without issue (and really like the R API!). Yesterday, when setting up a co-worker's computer, I noticed 2.0 is out on CRAN. I adapted the code I had used for qualtRicsConfigFile and created the .qualtRics.yml file as instructed into a new plain text file with Notepad (Windows machine). Unfortunately, when I ran registerOptions it threw an error: incomplete final line. So, it found the file OK but presumably hit a harmless error on readLines. Fortunately I was able to download the data by reading through registerOptions and setting the relevant options and environment variables.

Sys.setenv(QUALTRICS_ROOT_URL = "https://someorganization.qualtrics.com")
Sys.setenv(QUALTRICS_API_KEY = "ASDFqwertyNOTanAPIkey")
options(QUALTRICS_VERBOSE = T, QUALTRICS_USELABELS = T,
        QUALTRICS_CONVERTSTANDARDCOLUMNS = T,
        QUALTRICS_USELOCALTIME = F)

Maybe it's just a notepad issue, not sure. Wanted to let you know. Wonder if it wouldn't be easier to generate the yml file for the user...

@JasperHG90
Copy link
Collaborator

Hi Pete,

Thanks for your comment.

It's strange that R throws that error. Could you post a screenshot of the R console here?

On unix the readLines error you mention is a warning, and the file is still loaded. Is this also the case on Windows, or did you have to set your credentials manually?

You can resolve the error by adding an empty line to the end of the file (that's how readLines knows that it has reached the end of the file).

It's also possible to pass these parameters to the registerOptions() function. You don't need to set the environments and options manually.

I've thought about creating that file for the user and I might implement that in the next version. Thanks for the suggestion.

Best,

Jasper.

@rdrr1990
Copy link
Author

hey jasper,

The Windows machine with the problem is not my computer and unfortunately not sure when I'll next have access to it. Yesterday, I did try a couple versions of the yaml file (with and without an extra line break, with and without an extra line with ---) without luck. The error forced registerOptions to exit before it got to the settings. I had no option but to set the credentials manually with the above (which worked fine but may be a bit daunting for the typical survey analyst....).

I just installed qualtRics 2.0 on my mac and registerOptions works fine. I created the yaml file using RStudio and didn't hit the incomplete final line issue (which I think is just a warning on a Mac as well...).

Overall, the Windows machine wasn't mine and I didn't have any real time to troubleshoot so others may have better luck. But unless there's some reason not just to have registerOptions or qualtRicsConfigFile take care of the settings file, that might be the way to go...

HTH,

@JasperHG90
Copy link
Collaborator

I'll have a look at the CRAN policies to see whether altering files on a user's machine is allowed. Thanks for notifying me of this!

@JasperHG90
Copy link
Collaborator

I tried to reproduce this error on Windows 10 but everything went fine.

repro

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

2 participants