f <- function( column ) { ... ggplot(data, aes_string(x="name", y="rate", colour= column, group=column ) ) }