Often I use ggplot2 in my work and build wrapper functions to speed up my work flow. The use of the non-standard evaluation (NSE) aes forces me to use the actual variable n
There's the aes_string function, that I don't really see given prominence, which does exactly this:
FUN <- function(dat, x, y) { ggplot(dat, aes_string(x = x, y = y)) + geom_point() } FUN(mtcars, "mpg", "hp")