I have three dataset, they are three distinguished bird's assemblages and I'm trying to merge the test results in one plot together. Each one looks like this:
Exemple:
library(ggplot2)
beta1<-c(0.714286,0.625,0.72973,0.5625,0.733333,1,0.655172,0.92,0.769231,0.586207,0.724138,0.846154,
0.833333,0.76,1)
group<-rep(c("q0", "q1", "q2"), each = 5)
beta2<-c(1.714286,1.625,1.72973,1.5625,1.733333,1,1.655172,1.92,1.769231,1.586217,1.724138,1.846154,
1.833333,1.76,1)
dados1<-data.frame(beta1, group)
dados2<-data.frame(beta2, group)
p1<-ggplot(data=dados1, aes(x=group, y=beta1)) +
stat_summary(fun.y=mean, geom="line", aes(group=1)) +
stat_summary(fun.y=mean, geom="point")+ylim(0,2)
p2<-ggplot(data=dados2, aes(x=group, y=beta2)) +
stat_summary(fun.y=mean, geom="line", aes(group=1)) +
stat_summary(fun.y=mean, geom="point")+ylim(0,2)
the result that I need is like this:
I could do this:
ggplot() + stat_summary(fun.y=mean, geom="line", data=dados2, aes(x=group, y=beta2)) + stat_summary(fun.y=mean, geom="point", data=dados2, aes(x=group, y=beta2)) + stat_summary(fun.y=mean, geom="line", data=dados1, aes(x=group, y=beta1)) + stat_summary(fun.y=mean, geom="point", data=dados1, aes(x=group, y=beta1))+ylim(0,2)
but still not enough, because couldn't plot lines...