How can I put two graphs with error bars on one graph using ggplot.qplot
.
I've made it as far plotting one graph with error bars using this post:
library(ggplot2)
time_points = c(15, 30, 60, 90, 120, 150, 180)
control_data = c(1,2,3,4,5,6,7)
control_sd = c(0,1, 0.2, 0.3, 0.4, 0.5, 0.6)
treated_data = c(9,8,7,6,5,4,3)
treated_sd = c(0,1, 0.4, 0.6, 0.8, 0.8, 0.9, 1.5)
qplot(time_points, control_data) + geom_errorbar(aes(x = time_points,
ymin = control_data - control_sd,
ymax = control_data + control_sd))
How can I plot the treated data on on the same canvas?