R 垂直中心线

R 垂直中心线,r,ggplot2,broom,R,Ggplot2,Broom,对于下面的示例,我想在x轴的值1处添加一条垂直中心线。我尝试了geom_estci(),但我的R没有找到geom_estci函数。我安装了库ggplot2和扫帚。我试图安装ggepi库。但它不适用于R版本3.6.1。对于以下示例,如何在x=1处添加垂直中心线 d=data.frame(drink=c("coffee","tea","water"), mean=c(3,6,2), lower=c(2.6,5.6,1.8), upper=c(3.5,6.3,2.8)) ggplot()

对于下面的示例,我想在x轴的值1处添加一条垂直中心线。我尝试了
geom_estci
(),但我的R没有找到
geom_estci
函数。我安装了库ggplot2和扫帚。我试图安装ggepi库。但它不适用于R版本3.6.1。对于以下示例,如何在x=1处添加垂直中心线

  d=data.frame(drink=c("coffee","tea","water"), mean=c(3,6,2), lower=c(2.6,5.6,1.8), 
  upper=c(3.5,6.3,2.8))
  ggplot() + 
  geom_errorbarh(data=d, mapping=aes(y=drink, x=upper, xmin=upper, xmax=lower), height=0.2, size=1, 
  color="blue") + 
  geom_point(data=d, mapping=aes(y=drink, x=mean), size=4, shape=21, fill="white")

尝试添加
geom\u vline(xintercept=1)

ggplot() + 
  geom_errorbarh(data=d, mapping=aes(y=drink, x=upper, xmin=upper, xmax=lower), height=0.2, size=1, 
                 color="blue") + 
  geom_point(data=d, mapping=aes(y=drink, x=mean), size=4, shape=21, fill="white") +
  geom_vline(xintercept = 1)