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

problematic characters in data dictionary #290

Closed
begavett opened this issue Jan 21, 2020 · 8 comments
Closed

problematic characters in data dictionary #290

begavett opened this issue Jan 21, 2020 · 8 comments
Assignees
Labels
nonascii accommodate non-ascii character

Comments

@begavett
Copy link

> REDCapR::redcap_metadata_read(redcap_uri = myURI, token = myToken)
Error in inherits(ds, "data.frame") : object 'ds' not found

@wibeasley wibeasley self-assigned this Jan 21, 2020
@wibeasley
Copy link
Member

Hi @begavett, thanks for taking the time to report this. Can you provide any additional information?
And have you seen the TroubleshootingApiCalls vignette? Specifically, this part?

Can the user export their data dictionary? Sometimes the problem exists within the metadata/dictionary, instead of the actual data values. Verify the structure and content of this specific project is interpretable by your local environment.

library(REDCapR) #Load the package into the current R session, if you haven't already.
redcap_uri       <- "https://the.urlofyourinsitution.edu/api/"
token            <- "your-secret-token"
redcap_metadata_read(redcap_uri=uri, token=token)

If this fails, see “Problems in the project’s metadata/dictionary.” under Gotchas below.

@begavett
Copy link
Author

Hi @wibeasley

I noticed the exact same error appears when using redcap_read, but not when using redcap_read_oneshot. When using redcap_read_oneshot, I am able to correctly read in the data from REDCap.

@wibeasley
Copy link
Member

Ok, this makes sense, and is consistent with #272. But please provide more information so someone can help you better.

What happened when you followed the “Problems in the project’s metadata/dictionary.” in the troubleshooting vignette? Several people gave input when we wrote it, for the situation that I think you're in.

@begavett
Copy link
Author

begavett commented Jan 21, 2020

Thank you for alerting me to #272. I didn't originally encounter that issue in my search. Using a text editor, I found some non-ASCII characters in the data dictionary using a regex search for [^\x00-\x7F]+ and then replaced those with standard characters. That worked for me, so now I am able to successfully read in the data dictionary using redcap_metadata_read.

@wibeasley
Copy link
Member

@begavett, I'd really like to build up a test be of problematic characters.

  1. Will you please send an excerpt of the dictionary that contains the problematic characters? I'd really like to continue building the bank of problematic values that should be handled correctly.

  2. I'm also curious about why the encoding measures in kernel_api() didn't address this. Are you running the latest version from GitHub? What version of REDCapR?

  3. I like your regex search mentioned above. I may include that in the Troubleshooting document.

@begavett
Copy link
Author

begavett commented Jan 22, 2020

The problematic characters for me were:
− ("minus sign")
“ ("left double quotation mark")
” ("right double quotation mark")

There were also &nbsp; characters picked up by my regex search, but I'm not sure if they were causing any problems (I made my changes in batch so I wasn't able to test individual characters for problems).

This was done in REDCap 9.6.1 using v2.2 of redcapAPI and v0.10.2.9005 of REDCapR.

@wibeasley
Copy link
Member

@begavett, will you please go to the "Project Revision History" tab and download the last problematic dictionary. And then please send me the rows of the csv (at [email protected]) that you think might have caused problems?

As you can see from the existing bank I won't include your actual item. Just the problematic characters in the midst of otherwise meaningless metadata.

image

@wibeasley
Copy link
Member

@begavett, I've copied the characters you listed above and included them in the problematic-dictionary.csv. All the tests pass under the current version of REDCapR. But there's a chance that using the GitHub comments as a middleman subtly sanitized the characters.

I'd still like to see the exact few lines of the data dictionary with those characters you mentioned above --especially if the current version of REDCapR is still throwing an error with them. Building up the existing bank would help the package be more robust for everyone. If you're willing, please reopen the issue and include the exact lines. Or email the part of the data dictionary containing those variable descriptions.

@wibeasley wibeasley changed the title Error in inherits(ds, "data.frame") : object 'ds' not found problematic characters in data dictionary Jan 24, 2023
@wibeasley wibeasley added the nonascii accommodate non-ascii character label Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nonascii accommodate non-ascii character
Projects
None yet
Development

No branches or pull requests

2 participants