Error: Invalid input: date_trans works with objects of class Date only

Hello everyone,

I'm new here but I'm trying to graph the weekly average contagion curve (time series), a series of milestones, and a "Stringency Index" heatmap background.

However, after entering the necessary data and information, the error "Error: Invalid input: date_trans works with objects of class Date only"

Here is the code:

#Instalar Librerias
library(ggplot2)
library(dplyr)
library(tidyverse)
library(readxl)
library(lubridate)

#Se cargan las bases de excel desde GitHub Desktop
##Cargar casos promedio semanales
Bog <- read_excel("~/GitHub/covid-transport/Bogota_daily_cases.xlsx", 
                  range = "E2:F58")
View(Bog)

##Cargar stringency index para Colombia
stringency_index <- read_excel("Bogota_daily_cases.xlsx", 
                                 range = "R2:S428")
View(stringency_index)

##Cargar hitos legislación y transporte en Colombia
Hitos <- read_excel("Bogota_daily_cases.xlsx", 
                                 range = "H2:K24")
View(Hitos)

##Cambio de nombres de columnas por practicidad
colnames(Bog)=c("Semana","Casos")
colnames(stringency_index)=c("Dia","Index")
colnames(Hitos)=c("Fecha","Clase","Entidad","Hito")

max(Bog$Casos)

#Ajustes de de base de hitos dataframe-gráfica
baseline = min(Bog$Casos)
delta = 0.05 * diff(range(Bog$Casos))
#Hitos$ymin = baseline
Hitos$timelapse = c(diff(Hitos$Fecha),2020-03-01)
#Hitos$bump = Hitos$timelapse < 2*370 #~4 años
offsets <- rle(Hitos$bump)
Hitos$offset <- unlist(mapply(function(l,v) {if(v){(l:1)+1}else{rep(1,l)}}, l=offsets$lengths, v=offsets$values, USE.NAMES=FALSE))
Hitos$ymax <- Hitos$ymin + Hitos$offset * delta

#Realizar el Gráfico


##Crear el mapa base
base_line <- geom_line(data=Bog,aes(Semana,Casos,alpha=0.8))

##Integrar Stringency Index de Oxford
stringency <- geom_bar(data=stringency_index,stat="identity",width=1,aes(Dia,Index,fill=Index))

##Integrando el gráfico
ggplot()+stringency+base_line+
  theme_classic()+ 
  scale_fill_viridis_c("Stringency Index",begin=0.4,end=1,option="magma")+ # escala del mapa de stringency
  labs(x="Semana",y="Casos semanales promedio",
       title="Curva de contagios por COVID-19",
       subtitle="Casos promedio semanales en Bogotá, Colombia",
       caption=("Fuente de datos: saludata.saludcapital.gov.co"))+ ###labels
  scale_x_date(date_breaks = "1 month",date_labels="%m %y",limits=c(as.Date("2020-02-01"),as.Date("2021-04-01")))+ ###Cambiar escala del eje x
  scale_y_continuous(limits=c(0,5500))+ ###Cambiar escala de eje y
  geom_segment(data = Hitos, mapping=aes(x=Fecha, y=ymin, xend=Fecha, yend=ymax)) + ###Agregar lineas de Hitos
  geom_point(data = Hitos, mapping=aes(x=Fecha,y=ymax), size=1) + ###Agregar puntos de hitos
  geom_text(data = Hitos, mapping=aes(x=Fecha, y=ymax, label=Hito), hjust=-0.1, vjust=0.1, size=3)+ ###Agregar leyendas de hitos
  guides(alpha=FALSE)

The graph I intend to get to is like this:
image

If there is a problem with the database that I refer to in the beginning of the code, it is here in my personal drive, in case you want to visualize it

The excel file in the link you have provided doesn't have a "R2:S428" range so we can't test your code, please turn this into a self-contained REPRoducible EXample (reprex) illustrating your issue, including sample data on a copy/paste friendly format.