Skip to content

Conversation

@munoztd0
Copy link

@munoztd0 munoztd0 commented Apr 1, 2024

Created a new PR for making things simpler,

This pull request includes updates to the as.data.frame.px function to improve its robustness and ability to handle a wider range of inputs.

Changes made:

Updated the handling of 'to_values' in the mapvalues function. Now, 'to_values' is created by splitting the string x[[paste0('VALUES', use.language)]][[code_id]] at every occurrence of ", " and ",". This change was made to handle cases where x[[paste0('VALUES', use.language)]][[code_id]] is a single string that needs to be split into a vector of values.

Added a check to ensure that the 'from_values' and 'to_values' vectors are of the same length before they are used in the mapvalues function. If they are not of the same length, the function stops with an error message. This check was added to prevent errors in the mapvalues function.

These changes make the function more robust and capable of handling a wider range of inputs. Please review the changes and merge if everything looks good.

Also added chnages to the doc.

Now, 'to_values' is created by splitting the string x[[paste0('VALUES', use.language)]][[code_id]] at every occurrence of ", " and ",". This change was made to handle cases where x[[paste0('VALUES', use.language)]][[code_id]] is a single string that needs to be split into a vector of values. Also added a check to ensure that the 'from_values' and 'to_values' vectors are of the same length before they are used in the mapvalues function. If they are not of the same length, the function stops with an error message. This check was added to prevent errors in the mapvalues function and to make the function more robust and handle a wider range of inputs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant