test_data <-
data.frame(
var0 = 100 + c(0, cumsum(runif(49, -20, 20))),
var1 = 150 + c(0, cumsum(runif(49, -10, 10))),
var2 = 250 + c(0, cumsum(runif(49, -10, 10)))
)
Given the above test data, I would like to do the following:
(1) plot the lines similar to this: Plotting two variables as lines using ggplot2 on the same graph
(2) add an overall confidence band for these lines (lines can be seen as points), similar to this: Find points over and under the confidence interval when using geom_stat / geom_smooth in ggplot2
I know how to do them separately but not sure how to combine them in a single plot.