aim-rsf / browseMetadata

An R package to help a researcher browse metadata for health datasets and categorise variables based on research domains
https://aim-rsf.github.io/browseMetadata/
GNU General Public License v3.0
3 stars 1 forks source link

Error catching in user_categorisation.R #82

Closed RayStick closed 3 weeks ago

RayStick commented 3 months ago

'Categorise this data element into one or more domains, e.g. 5 or 5,8:'

No input will break the code (it accepts anything and reads it in as a string) but it would be good to catch silly input errors and feedback to the user, so they don't get saved in the csv. However, the review stage mitigates this somewhat (i.e. a user may spot an error in the review stage and correct it themselves)

DDelbarre commented 1 month ago

After some user testing, I have a few suggestions related to this issue.

When users are entering codes while using domain_mapping, validating their choices against the list of domain codes would help to improve the quality of the responses by ensuring that only valid options can be selected. Currently, anything the user enters is accepted

DDelbarre commented 1 month ago

When the user enters multiple options, it would be useful if there could be some control on how the options are interpreted (and subsequently saved in the log file). For example, by stripping out whitespace so that the following would all get interpreted the same way, and also accounting for users accidentally using the wrong field separator:

Additionally, if one user enters "3,6" and another user enters "6,3", then when the log files are run through compare_csv_outputs, they are currently treated as different sets of options. This could be remedied by having the options sorted before they are saved to the log files (so for the example above, both users would have had "3,6" in their log files even though they entered them differently).