Function argument naming conventions (`.x` vs `x`)

Looking at the tidyverse as a whole, it seems that it is slowly becoming a preferred style. For instance:

  • in ggplot2, data is referred to as data

  • in dplyr, it is referred to as .data some of the time, with a lot of inconsistencies (will submit a PR on this). Other arguments sometimes use the dot and sometimes don't. It is a bit messy... but there is a first flavour of this dot idea

  • in purrr, this idea is fully fledged and applied consistently to every argument, function and variable

So, to go back to your first question, I think it is something that has grown over time amongst the developers of the tidyverse, but that is still far from being consistently implemented in it. If new package releases implement it consistently across the entire tidyverse, then the question of whether it should be added to the style guide or not may become relevant. But at this point, it is very purrr specific (with some messy dplyr non-fully fledged applications).

2 Likes