## script to run automated app pipeline
## NOTE: if used locally edit submission dir as needed
## using here::here("submission", "SigSci-TS") was not working on app refresh
submission_dir <- "/submission/SigSci-TS"
library(focustools)
library(tidyverse)
## Get national data
national <- inner_join(
get_cases( source="jhu", granularity="national"),
get_deaths(source="jhu", granularity="national"),
by = c("location", "epiyear", "epiweek"))
## Get state data
state <- inner_join(
get_cases( source="jhu", granularity="state"),
get_deaths(source="jhu", granularity="state"),
by = c("location", "epiyear", "epiweek"))
## combine US and state data
usafull <-
bind_rows(national, state) %>%
filter(location %in% c("US", stringr::str_pad(1:56, width=2, pad="0"))) %>%
make_tsibble() %>%
filter(monday>"2020-03-01")
focus_explorer(.data = usafull,
submission_dir = submission_dir,
host = "0.0.0.0",
port = 3838,
launch.browser = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.