-
Notifications
You must be signed in to change notification settings - Fork 48
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
redcap_download_file_oneshot() only downloads from instance 1 regardless of repeat_instance value #506
Comments
Looks like you need to also provide the repeat_instrument parameter. |
Ahh that's working now, thank you. However this was not immediately obvious on first sight. Is it possible to include some sort of error message if repeat_instance is modified, but repeat_instrument is not included? Currently the download silently reverts to the first instance, which is easy to miss. |
@nathhenry3, I finally pulled @BlairCooper's improvements and added the tests. I'm pulling it into the main branch in a few minutes. Tell me if this doesn't fix you scenario. Or if you'd like to change the documentation. |
I am trying to use the redcap_download_file_oneshot() function to extract files for specific variables from a large REDCap project. This project has repeating instruments, and so I am running the function in a loop for multiple values of 'instance' to download all files for each repeated instance.
However, it appears that the function is only downloading the file from the first instance of the repeating instrument, regardless of the value of repeat_instance.
Here's the code that I'm running:
file_download <- REDCapR::redcap_download_file_oneshot(redcap_uri = uri, token = api_token, record = record_id, field = field_name, event = event_name, repeat_instance = instance, directory = directory, overwrite = TRUE, verbose = TRUE )
where 'instance' changes with each iteration.
Desktop:
Thanks a lot!
The text was updated successfully, but these errors were encountered: