CenterForAssessment / randomNames

Function to generate random gender and ethnicity correct first and/or last names. Names are chosen proportionally based upon their probability of appearing in a large scale data base of real names.
https://centerforassessment.github.io/randomNames
Other
32 stars 6 forks source link

Partial argument matching in `rep()` #81

Closed joshwlambert closed 7 months ago

joshwlambert commented 10 months ago

First and foremost, just to say that I really like the {randomNames} R package. It has been really useful for a package we're developing in the Epiverse-TRACE intiative: {simulist}.

Within that package we use a testing setup option that automatically checks whether we are using partial argument matching (i.e. only matching some of the argument name within a function which is then matched to the full argument name by R). This check also picks up if dependencies used within the package are using partial argument matching, and it has detected some in {randomNames}.

Specifically, the rep() function, where currently, length is being used and partially matched to length.out. It would be great if this could be updated to avoid partial matching. I've added some links at the bottom of this issue to why using partial matching can make code brittle.

I'm happy to make a PR from a fork of the package to make the recommended changes.

Links: