Aloha. I find that ggplot syntax is not consistent when used in a function versus interactively invoked. Maybe someone can comment on this quirk?
This syntax works inside a function:
p1 = ggplot(data, aes(x, y)) + geom_point()
invisible(print(p1))
This syntax does not work inside a function:
p1 = ggplot(data, aes(x, y))
p1 + geom_point()
invisible(print(p1))
The second syntax does work when interactively invoked. Why the difference, please?