Writing R functions that rely on tidyverse functionality can be tricky. In this thread, I will share screenshots of a handout I put together on writing such functions using a common use case: plotting histograms. #rstats
For any R function that uses tidyverse functionality inside its belly, the first crucial question is:
Will the function use the entire dataset AND one or more variable names as arguments?
The second crucial question is:
When we apply the function to a particular dataset and to particular variable names pulled from that dataset, will we want to use quotes around those variable names or not? (The dataset will NOT need quotes around its name.)