I have a project where I have error = "error in seq.int(0, to0 - from, by) : 'to' must be a finite number" Here is the code. Can y'all help?
library(ggplot2)
library(dplyr)
library(plyr)
library(tidyverse)
library(DataExplorer)
library(ggrepel)
raw_data = mutate(raw_data, Date.Announced= as.Date(Date.Announced, format="%d/%m/%y"))
raw_data = raw_data[order(as.numeric(raw_data$Date.Announced)),]
daily_rate = raw_data[,c("Date.Announced" , "Patient.Number")]
count_daily = count(daily_rate,"Date.Announced")
count_daily
ggplot(count_daily, aes(x=Date.Announced, y=freq)) +
geom_segment( aes(x=Date.Announced, xend=Date.Announced, y=0, yend=freq),
color="red") +
geom_point( color="orange", size=1) +
theme_light() +
scale_x_date(date_breaks = "1 week",date_labels = "%d %b")+
theme(
panel.grid.major.x = element_blank(),
panel.border = element_blank(),
axis.ticks.x = element_blank()
) +
xlab("") +
labs(title = "Daily Increase in the Number of Patients")+
ylab("Number of patients")
I know it is an error related to date format but I have no idea as to how to solve it.