R 用几何误差条定位减淡

R 用几何误差条定位减淡,r,ggplot2,R,Ggplot2,我有以下代码 require(ggplot2) pd <- position_dodge(0.3) ggplot(dt, aes(x=Time, y=OR, colour=Group)) + geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), colour="black", width=.4, position=pd) + geom_point(size=2.2, position=pd) + geom_hline(a

我有以下代码

require(ggplot2)
pd <- position_dodge(0.3)
ggplot(dt, aes(x=Time, y=OR, colour=Group)) + 
    geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), colour="black", width=.4, position=pd) +
    geom_point(size=2.2, position=pd) +
    geom_hline(aes(yintercept=1), colour="#990000", linetype="dashed")

有谁能告诉我如何将减淡应用于错误栏和点吗?

它需要一个分组变量:

ggplot(dt, aes(x=Time, y=OR, colour=Group)) + 
  geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper, colour=NULL, group=Group),  
                 position=pd) +
  geom_point(size=2.2, position=pd) +
  geom_hline(aes(yintercept=1), colour="#990000", linetype="dashed")

ggplot(dt, aes(x=Time, y=OR, colour=Group)) + 
  geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper, colour=NULL, group=Group),  
                 position=pd) +
  geom_point(size=2.2, position=pd) +
  geom_hline(aes(yintercept=1), colour="#990000", linetype="dashed")