I want to plot a line graph of multiple states of India affected by COVID19. The code is as follows:
swd <- data.frame(read.csv(url("https://api.covid19india.org/csv/latest/state_wise_daily.csv"),stringsAsFactors = F))
swd$Date <- anydate(swd$Date)
swd$Date <- as.Date(swd$Date,format = "%y/%m/%d")
swc <- swd %>% filter(Status == "Confirmed")
b <- ggplot(swc, aes(x = Date)) + geom_line(aes(y = MH, color = "darkred")) + geom_line(aes(y = GJ, color = "steelblue")) + geom_line(aes(y = TN, color = "yellow")) + geom_line(aes(y = RJ, color = "green")) + geom_line(aes(y = DL, color = "orange")) + geom_line(aes(y = UP, color = "pink")) + geom_line(aes(y = MP, color = "red")) + geom_line(aes(y = WB, color = "blue")) + geom_line(aes(y = BR)) + geom_line(aes(y = KL, color = "teal"))
ggplotly(b)
But I get the following error:
Error in seq.int(0, to0 - from, by) : 'to' must be a finite number
I don't know how to solve it, Please help!!