how to add dashed horizontal line with label in ggplot

I have plotted a line plot. I have added a horizontal line on the plot. How to take horizontal line red dashed?

# Sample Data 

library(tidyverse)
Month= c("Jan","Feb","Mar","Apr","May","Jun")
a = c(11,10,9,8,4,8)

test= data_frame(Month,a) 
test$cum_total <- cumsum(test$a)

test$Month <- factor(test$Month, month.abb)

# ggplot

ggplot(data=test, aes(x=Month, y=cum_total, group=1)) +
  geom_line()+
  geom_point()+
  geom_hline(yintercept=40)+
  annotate("text", x = "Feb", y = 40, label = "Previous Level", vju

Leave a Comment