Is it possible to add a line (such as an additional time series) to an already existing plot? I know how to add horizontal or vertical lines, but how can I add from other data.
by using ggplot() instead of qplot(), you can have more flexibility. here is a minimal example using two datasets:
d1 <- data.frame(x1=rep(1:10,3), y1=rnorm(10*3), g1=gl(3,10,labels=letters[1:3]))
d2 <- data.frame(x2=rep(1:10,3), y2=rnorm(10*3), g2=gl(3,10, labels=letters[4:6]))
ggplot() +
geom_line(aes(x1, y1, colour=g1), d1) +
geom_line(aes(x2, y2, colour=g2), d2)