pxR icon indicating copy to clipboard operation
pxR copied to clipboard

Update handling of 'to_values' in as.data.frame.px function

Open munoztd0 opened this issue 1 year ago • 0 comments

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.

munoztd0 avatar Apr 01 '24 16:04 munoztd0