0

Previously I have been successfully using the redcapAPI package to import data from a REDCap database into R.

library("redcapAPI")
rcon <- redcapConnection(token="mytoken"),
                         url = 'my REDCap api url')

df <- data.frame(exportRecords(rcon))

The above code used to return a dataframe with my data, but I am now getting the error below:

The call syntax of exportRecords will undergo a breaking change in the upcoming 3.0.0 release. See Issue #10
Error in exportRecords(rcon) : 1 assertions failed:
 * The field choice string does not appear to be formatted for choices.

I don't know how to interpret the error message, but I suspect some change has been made to the R package or my local API. Any help would be most appreciated.

wibeasley
  • 5,000
  • 3
  • 34
  • 62
TBP
  • 92
  • 6
  • What version of `redcapAPI` are you using? – MrFlick Apr 13 '23 at 12:55
  • 1
    That message was [added three weeks ago](https://github.com/vubiostat/redcapAPI/commit/86909385795279227a10ab16385c60ff38436c47) to the package. I don't use that package, but I'm going to guess that the upstream API is changing or the author of this package is refactoring their code. Either way, I suggest you make sure you are on the newest version, and reach out to the maintainers/authors for more info on how to adapt to the new process(es). – r2evans Apr 13 '23 at 12:55
  • 1
    You might want to try the development version. Are you able to run `devtools::install_github("vubiostat/redcapAPI")`? I think that might fix your problem (and if not, I'd be interested in seeing what your metadata look like, if possible). You might also try the new `exportRecordsTyped` function. – Benjamin Apr 13 '23 at 14:20
  • I was using the CRAN package version 2.5.0, but switching to development version (2.7.0) fixed the issue. Thank @Benjamin – TBP Apr 13 '23 at 15:59

0 Answers0