垂直中心线

Vertical Centre Line

对于下面的示例,我想在 x 轴的值 1 处添加一条垂直中心线。我尝试了 geom_estci(http://ggepi.lukewjohnston.com/reference/geom_estci.html),但我的 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_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)