I have a single dataset that I am trying to filter multiple ways and in order to plot a number of graphs and save them to a single multichart pdf. To start I have tried the following:
pdf("LB_plus_UB_plots_3_problems_osc_10.pdf")
for (i in 1:10) {
ggplot(data=dataset,aes(x=glim_f,y=LB,colour=state))+geom_line()+geom_line(aes(glim_f,UB,colour=state),dataset)
}
dev.off()
which is producing a single blank pdf. Strangely when I execute the lines individually, it produces the pdf as I want it with 10 parts. Am I missing something?