我正在尝试手动将置信区间的阴影添加到具有两种不同季节的多种植被类型的折线图中。我使用r2winBUGS来计算每个点的95%置信区间,但现在我试图将这些计算的置信区间添加到图中。 这是我想要将置信区间添加到。
的图表这是我的数据:下限是下限,上限是上限。
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)) -> i
n <- i + geom_point(aes(color = factor(Type))) + facet_wrap(~invci$Season)
+ geom_line(aes(color = factor(Type))) + labs(colour = "Type")
我一直在尝试使用geom_ribbon:
ci <- n + geom_ribbon(aes(ymin = Lower, ymax = Upper), alpha = .3, linetype=2)