r - Manually adding confidence interval shading to multiplot line graph in ggplot2 -


i trying manually add shading of confidence interval line graph multiple types of vegetation on 2 different seasons. used r2winbugs calculate 95% confidence interval each point, attempting add calculated confidence intervals plot. graph want add confidence interval to.

enter image description here

this data: lower lower bound , upper upper bound.

    type       season period     ticks lower upper  11 invasive      1      1 0.011256249 0.004 0.016  12 invasive      1      2 0.008556320 0.004 0.011  13 invasive      1      3 0.006569459 0.004 0.009  14 invasive      1      4 0.005106834 0.003 0.007  15 invasive      1      5 0.004036758 0.002 0.006  16 invasive      2      1 0.007419884 0.005 0.010  17 invasive      2      2 0.011886079 0.009 0.015  18 invasive      2      3 0.019135467 0.015 0.023  19 invasive      2      4 0.030961773 0.024 0.038  20 invasive      2      5 0.050353671 0.036 0.068  21   native      1      1 0.009722436 0.002 0.008  22   native      1      2 0.007394854 0.004 0.013  23   native      1      3 0.005683424 0.007 0.020  24   native      1      4 0.004424967 0.011 0.032  25   native      1      5 0.003505384 0.017 0.053  26   native      2      1 0.006407294 0.003 0.012  27   native      2      2 0.010282212 0.003 0.009  28   native      2      3 0.016583555 0.002 0.007  29   native      2      4 0.026882597 0.002 0.005  30   native      2      5 0.043801800 0.001 0.004   ggplot(data = invci, aes(x = period, y = ticks)) ->  n <- + geom_point(aes(color = factor(type))) + facet_wrap(~invci$season)        + geom_line(aes(color = factor(type))) + labs(colour = "type") 

i've been trying use geom_ribbon:

 ci <- n + geom_ribbon(aes(ymin = lower, ymax = upper), alpha = .3, linetype=2) 

but been getting this. enter image description here


Comments