I would like to set different colours for geom_errorbarh, like when average_att is over 1, the colour is red, and when it is lower than -1, the colour is blue. the colour is blue.
forestdata <- data.frame(city = c("HK6", "IS2", "CR5"),
average_att = c(0.752007081, -4.384720798, -0.66515768),
average_att_lower = c(-1.284027031, -6.088057285, -3.094599095),
average_att_upper = c(2.073787674, -2.637218695, 1.766942459))
ggplot(forestdata, aes(average_att, city))+
geom_errorbarh(aes(xmax =average_att_upper, xmin = average_att_lower),size= 1,height = 0.1, colour = "cyan4") +
geom_point(size=2,color = "black")+
scale_x_continuous(limits= c(-6.5, 6.5))+
geom_vline(aes(xintercept = 0),color="darkgoldenrod2", size = 1,alpha=0.5)

