I want to combine two ggplots, from two different data.frames, into one plot. Below you will find the code. I want to combine graph 1 and graph 2 or graph 3 & 4.
df1 <- data.frame(p=c(10,8,7,3,2,6,7,8), v=c(100,300,150,400,450,250,150,400)) df2 <- data.frame(p=c(10,8,6,4), v=c(150,250,350,400)) plot1 <- qplot(df1$v, df1$p) plot2 <- qplot(df2$v, df2$p, geom="step") plot3 <- ggplot(df1, aes(v, p)) + geom_point() plot4 <- ggplot(df2, aes(v, p)) + geom_step()
It should be very easy to do, but somehow I can't get it to work. Thank you for your time.
r ggplot2
jeroen81 Feb 02 '12 at 8:26 2012-02-02 08:26
source share