tidyverse / style

The tidyverse style guide for R code
https://style.tidyverse.org
Other
298 stars 104 forks source link

How to reference a family of functions with a shared prefix #154

Open batpigandme opened 4 years ago

batpigandme commented 4 years ago

Do we have a principle re. where to use an asterisk and/or parentheses when referencing a family of functions (e.g., rows_ vs. rows_*() vs. rows_*)? I think the above absence of parentheses is correct because the word "functions" comes after rows_, but I want to generalize a rule so we can add it to the style guide.

Originally posted by @batpigandme in https://github.com/tidyverse/tidyverse.org/pull/431

batpigandme commented 4 years ago

Other examples From https://github.com/hadley/adv-r/blob/a54903729dfa79fa79af5776218e6bc781e98c3d/Functionals.Rmd#L140

All map_*() functions can take any type of vector as input.

From https://github.com/jennybc/analyze-github-stuff-with-r

Use map_*() functions to extract and data-frame-ize the potentially useful parts of the pull request list.