I want to use my function f() regarding ggplot, but it is not working. Please tell me how to solve this.
f= function(){
geom_point() + geom_line()
}
data_frame = tibble(y_axis = c(1,2,3,1,1,1),
x_axis = c("AD", "B", "C", "A", "B", "C"),
g = c("buy", "sell", "buy", "sell", "buy", "sell"))
g2 <- ggplot(data_frame, aes(x=x_axis, y=y_axis, colour = g,group = g)) + f()
g2