Closed biostatisticsfun closed 2 months ago
Hello Andrew,
Thank you for bringing this issue to our attention. We will take a look into the first error. Regarding the second error, in order to read local files using redcap_data(), all files must be located in the same directory. Could you please confirm this is the case?
Thank you, João
Hi João,
Thank you for your reply. For the second error, yes I tried 2 things:
Both options gave "No such file or directory". I'm also able to read the files in directly with read.csv() function in both cases so I know I'm specifying the right path in both cases.
Best, Andrew
Regarding the first error:
Regarding the second error:
The data_path argument is refering to the R file with the code to read the data and the dictionary path argument to the csv file with the dictionary.
Thank you once again.
Best regards, João
Hi João,
Please see attachment and I modified choices with sensitive information.
For the second error, I figured out that the .R file specifies a path to the dataset (csv) and when I changed this, the code worked. I see now that the REDCap export to R provides the .R file and csv dataset. Apologies if this was obvious, I am new to REDCap. Test.xlsx
Best, Andrew
Good morning Andrew,
Perfect, thanks for sharing the file.
The problem was caused by some of the radio button options starting with words instead of numbers (e.g. the xx, Other
option of the race
variable). We had only worked with options starting with numbers until now.
We have adapted the redcap_data()
function to handle both formats.
We are committing a new version of the package that fixes this issue to github, which you can download using:
remotes::install_github('bruigtp/REDCapDM')
Could you please try this new version and read the data using the API connection to confirm that the problem has been resolved?
Regarding the second error, we acknowledge that the arguments in the redcap_data()
function are not explicit, so we have also added a warning in case someone uses another file type that is not an R file, indicating that the only supported type is R files.
Thank you very much for helping us improve the package, and if the problem is solved, we would be grateful if you would let us know and close this issue.
Best regards, João
Hi João,
Thank you so much for working on this issue! Yes, I have re-installed and the API command works!
For the second error, it may be helpful for newer REDCap users (like me) to indicate that 3 files are needed (.R, data csv, dictionary csv) in the redcap_data() function (while the function only calls upon .R and dictionary csv files).
Thank you again for working on this issue and making the workflow between REDCap and R a great experience!
Best, Andrew
Hello, I am having an issue with the redcap_data() function.
1) Using redcap_data() through API, I'm receiving this error:
2) Then I tried using redcap_data() with local files and received this error:
It looks like it is not reading in the dictionary file and I can read in the dictionary csv with read.csv() too.
Thank you for any support.
Best, Andrew
sessioninfo sessionInfo()