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:
Convert all statements after the first one from if() to if else()
Add mapping of column names to match on to arguments (e.g. firstnamecol, lastnamecol, dobcol etc.)
Add stop() functions and error messages in case the user has not supplied the right column names for the matchcols argument.
Update the example to include the new column name arguments.
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:
if()
toif else()
stop()
functions and error messages in case the user has not supplied the right column names for thematchcols
argument.