There seem to be two ways to think about this.
Approach 1: Separation of problems.
I like that my story materials are very different from my controversial things. In addition, you can name your group, which considers the easiest way to solve your problem [although you lose the original column name]. Thus, one way of deciding what you are trying to do is through;
library(tidyverse) concern1_data <- function(df, col) { group <- enquo(col) df %>% group_by(group = !!group) %>% summarise(n = n()) } concern2_plotting <- function(df){ ggplot(data=df) + geom_bar(aes(group, n), stat = "identity") } mtcars %>% concern1_data(am) %>% concern2_plotting()
This ensures that you are trying to do more or less, and keep problems separate (which deserves mention).
Approach 2: Accept and Wait
The fact is that tidyeval is not yet implemented in ggplot2. - Colin Fye from the link
I think this is support that is not currently in ggplot2, but I cannot imagine that ggplot2 will not receive this functionality. This is just not there.
cantdutchthis
source share