I would like to successively add lines to a ggplot
object. But I can't get the following supposedly simple code to work:
The data frame contains time series which I want to plot for periods 0 to 20.
p <- ggplot(data=dfp, aes(x=seq(0,20,1), y=dfp) )
for (i in 1:7) {
p <- p + geom_line(aes(y=dfp[i]))
}
p