I want to create a ggplot2 incrementally, where I add a number of lines to an existing plot like this:
pl = ggplot()
pl = pl + somesetup
while(stillhavelines) {
df = getTheLine(fromsomewhere)
pl = pl + geom_line(aes(df$x,df$y),linetype=lt,colour=co) ## !!!!
}
ggsave(...)
The odd thing is that if I do this then all the line plots will be shown from one single data frame. I instead I try doing this by assigning each dataframe to its own variable it works.
How can I tell ggplot to actually show the lines from the different data frames? Why does it even do this, it is extremely suprising and unintuitive.

geom_linescommand only varying labels etc (or folding labels, colors, etc into your data frame in a weird way) you might want to use a loop.facet_grid; no cowplot necessary.