I am trying to add vertical lines to a ggplot that displays count data per month. My x-axis is month as a factor, but my vertical lines represent Julian days.
For example, with these data:
dat <- structure(list(Month = structure(1:12, .Label = c("Jan", "Feb",
"Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
"Dec"), class = c("ordered", "factor")), Data = c(1, 1, 2, 2,
6, 11, 19, 23, 19, 13, 5, 1)), .Names = c("Month", "Data"), class = "data.frame", row.names = c(NA,
-12L))
I can make the following bar plot
ggplot(dat)+ geom_bar(aes(x= Month, y = Data), stat="identity")
How can I then add two vertical lines with the x-intercept of Julian day 68 and 252 using geom_vline?
I am not sure how to plot the lines which reference a continuous scale on the monthly (factor) x-axis data.