This question pertains to the second type of ggplot which does not request reshaping to longer data frames. Reshaping to a longer data frame isn't easily done in this case due to the memory requirements.
Only answers that begin with ggplot(df) will be accepted. If you do not wish to follow the ggplot(df) manner then please ignore this question and move on.
df=data.frame(xx=runif(10),yy=runif(10),zz=runif(10))
require(ggplot2)
ggplot(df) +
geom_line(aes(xx,yy, color='yy'))+
geom_point(aes(xx,yy, color='yy'))+
geom_line(aes(xx,zz, color='zz'))+
geom_point(aes(xx,zz, color='zz'))+
ggtitle("Title")
Is there a way to create a geom_both function that works in the ggplot manner?
This does not work:
geom_both=function(...) { geom_line(...)+geom_point(...) }