I am building a plot with ggplot but I do not know the name of the y column in advance. Instead the name of the y column is contained in the variable yname. This obviously doesn't work:
ggplot(df, aes(x=date, y=yname))
Because ggplot looks for a column in df that is literally named "yname". How can I pass the name of the y column to ggplot as a variable?