How to label vLines in ggplot (R)

The are multiple issues with your annotate:

  1. annotate has no mapping argument. Hence, using aes(...) results in an error as it is passed (by position) to the x argument. And as aes(...) will not return an object of class Date it will throw an error.

  2. As you want to add a label use x instead of xintercept. geom_label. has no xintercept aesthetic.

  3. There is no need to wrap the dates in as.numeric.

Using the ggplot2::economics dataset as example data you could label your vertical lines like so:

library(ggplot2)
library(lubridate)

ggplot(economics, aes(x = date, y = uempmed)) +
  geom_vline(aes(xintercept = ymd("1980-10-26")), color = "red") +
  geom_vline(aes(xintercept = ymd("2010-02-10")), color = "blue") +
  geom_line(color = 1, lwd = 0.25) +
  scale_x_date(expand = c(0, 0)) +
  annotate(x = ymd("1980-10-26"), y = +Inf, label = "Ignite", vjust = 2, geom = "label") +
  annotate(x = ymd("2010-02-10"), y = +Inf, label = "Ignite", vjust = 2, geom = "label")