bruigtp / REDCapDM

R package to perform data management of REDCap datasets in R
https://bruigtp.github.io/REDCapDM/
Other
4 stars 0 forks source link

Inconsistent Naming of Checkbox Variables between API and Manual Downloads #5

Closed munozedg closed 2 months ago

munozedg commented 5 months ago

Description of the Issue:

When obtaining data from a REDCap project, I've noticed an inconsistency in how checkbox variables are named, depending on the method used to download the data. Specifically, the naming convention differs between data obtained directly using the REDCap API (with an API key) and data downloaded manually through the REDCap project interface.

Expected Behavior:

For data downloaded manually from the REDCap project, checkbox variables are renamed as expected: each dichotomic variable is named with the root name plus the category's label. This naming convention is intuitive and aligns with my requirements for data processing and analysis.

Observed Behavior:

However, when downloading the data programmatically using the REDCap API, the checkbox variables are created differently and do not follow the aforementioned naming convention. This inconsistency poses a challenge to automating data processing workflows, as the variable names differ from expected based on the manual download method.

Request:

I want to request an enhancement or a fix that ensures consistent naming of checkbox variables, particularly when data is obtained via the REDCap API. The desired outcome is for the API download method to rename checkbox variables in the same way as the manual download process, appending each dichotomic variable with the root name plus the category label OR leaving the original suffix, which is based on the actual numerical code used in the original data.

This consistency would greatly facilitate the automation of data processing and analysis workflows for users who rely on the API for data retrieval from REDCap.

Thank you for your attention to this matter. I am excited to find a solution that supports uniform naming conventions across different data download methods.

After using manually downloaded files: image

After downloading the data using the API call: image

munozedg commented 5 months ago

This issue occurs when downloading data through the API but not when downloading the files manually.

image

jcarmezim commented 5 months ago

Good morning @munozedg, Sorry for the delayed response. We are working on the issue and will get back to you as soon as it is resolved. Thank you again for your feedback

jcarmezim commented 5 months ago

Hi @munozedg

We attempted to replicate the same scenario, but in our case, we achieved the same result whether utilizing the API connection or employing the exported files from REDCap.

Using API: image

Using exported files: image

Could you please provide us with more information about the variable in question before the transformation?

Thank you in advance.