I have made multi facet ggplot
using the facet_wrap
function but could not find something that would let me create secondary y axis for a particular variable for all my plots.
I have tried looking in google and found http://rpubs.com/kohske/dual_axis_in_ggplot2 but i am not sure how to go from here to multi facet plots.
I melted the dataset to get to get the different facet plots but cant figure how to put in a secondary y axis for the particular variable in group.
fig4bplot<- ggplot(fig4b,aes(x=as.Date(time),y=value,group=variable,color=variable))+geom_line(size=2,alph a=4/5)+facet_wrap(~ Area)+theme_bw()
fig4bplot<-fig4bplot + theme(legend.position="bottom",legend.direction ="vertical")+opts(axis.text.x = theme_text(angle = 90))
fig4bplot<-fig4bplot+xlab("Time")+ylab("One-Step Ahead Squared Forecast Error")+theme(text = element_text(size = 30),
axis.title = element_text(size = 30),
axis.text.x = element_text(size = 20,))