次のデータ フレームを使用します。
day <- c("Mon","Tues","Wed","Thurs","Fri","Sat","Sun","Week","Mon","Tues","Wed","Thurs","Fri","Sat","Sun","Week")
day <- factor(day, level=c("Mon","Tues","Wed","Thurs","Fri","Sat","Sun","Week"))
month<-c("Jan","Jan","Jan","Jan","Jan","Jan","Jan","Jan","Feb","Feb","Feb","Feb","Feb","Feb","Feb","Feb")
month<-factor(month,level=c("Jan","Feb"))
snow<-gl(1,16,labels=c("Y"))
snow<-factor(snow,levels=c("Y","N"))
count <- c(4,5,6,8,3,4,9,5.57,2,4,3,7,1,9,3,4.14)
d <- data.frame(day=day,count=count,month=month,snow=snow)
バー ラベルは、正しい月のバーではなく、週を中心にしています。
ggplot()+geom_line(data=d[d$day!="Week",],aes(x=day, y=count, group=month, colour=month))+geom_bar(data=d[d$day=="Week",],aes(x=day, y=count, fill=month),position="dodge", group=month)+facet_wrap(~snow,ncol=1,scales="free")+scale_x_discrete(limits=levels(d$day))+geom_text(data=d[d$day=="Week",],aes(x=day, y=count,label=paste(month),vjust=1.5),position="dodge",size=3)
月のラベルを適切なバーの中央に表示できますか?