WorldHealthOrganization / godataR

R package for easier interactions with the Go.Data API
Other
12 stars 2 forks source link

match_lab2cases runs the wrong methods for different matchcols #9

Closed AmyMikhail closed 2 years ago

AmyMikhail commented 2 years ago

Problem statement:

When the user provides the matchcols argument, e.g. `matchcols = 'names & dob' the if statements in the function are processing in the incorrect order.

Proposed solution:

  1. Convert all statements after the first one from if() to if else()
  2. Add mapping of column names to match on to arguments (e.g. firstnamecol, lastnamecol, dobcol etc.)
  3. Add stop() functions and error messages in case the user has not supplied the right column names for the matchcols argument.
  4. Update the example to include the new column name arguments.