Without a a reprex
(see the FAQ), it's hard to see what's going on in your function.
library(ggplot2)
p <- ggplot(mtcars, aes(mpg,hp))
add_points <- function(x) {
x + geom_point()
}
add_points(p)
Without a a reprex
(see the FAQ), it's hard to see what's going on in your function.
library(ggplot2)
p <- ggplot(mtcars, aes(mpg,hp))
add_points <- function(x) {
x + geom_point()
}
add_points(p)