I'm trying to write a function for ggplot to define aes arguments. But I get errors running it since the internal column headings are not objects in themselves like the data frame is. For example:
df <- data.frame(conc = c(2, 3, 3.7), abs = c(0.2, 0.31, 0.33))
ggplot(df, aes(x = conc, y = abs)) + geom_point()
plot <- function(a, b, c) {
ggplot(a, aes(x = b, y = c)) + geom_point()
}
plot(df, conc, abs)
Is there any way to define aes this way using a function?