Is it possible to add a vertical line to a ggplot graph with data of class Week on the x-axis? For example
library(tsibble)
#>
#> Attaching package: 'tsibble'
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, union
library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 4.1.3
DF <- data.frame(dt = yearweek("2000W01") + 0:20, val = 0:20)
ggplot(DF, aes(x=dt, y=val)) +
geom_point() +
geom_vline(xintercept = as.numeric(yearweek("2000 W10")))
Created on 2022-05-11 by the reprex package (v2.0.1)
Note that no error message appears; the graph simply appears without any vertical line.
Any help greatly appreciated.