I am trying to create a function in r using ggplot. This is my code so far:
breakchart<-function(df,x,y) {
ggplot(df,aes( {{x}} ,{{y}})) + geom_point() +
ylim(-20,20) + xlim(-20,20) +
geom_hline(yintercept = 0) +
geom_vline(xintercept = 0) +
ggtitle(" Break Chart")
This has worked. However, I want to add a color aesthetic to my graphing function. EXAMPLE: ggplot(df,aes( x , y, color = ??)) + geom_point()
I am not sure how to do this without causing an error. Does anybody have an idea how to do this? Thanks

xandy? ie,aes({{ x }}, {{ y }}, color = {{ color }})? What have you tried, and what error are you seeing?