library(CoV19)
x <- subset(states, region=="NY")
x$icu <- as.integer(round(0.03*x$positive,0))
p1 <- my_plot(x, "NY")
p1 <- add_vline(p1, "NYC schools close", "2020-03-16")
p1 <- add_vline(p1, "stay at home order", "2020-03-20")
y <- x %>% pivot_longer(
  cols = c("hospitalized", "death", "icu"),
  names_to = "type",
  values_to = "count",
  values_drop_na = FALSE)
p2 <- qplot(date, count, data=y, geom="line", color=type)
grid.arrange(p1,p2, ncol=1)


eeholmes/CoV19 documentation built on Oct. 19, 2021, 10:59 a.m.