This importation package runs a model to estimate importations of SARS-CoV-2 into airports globally. The current package includes data to estimate importations into U.S. airports.
library(covidImportation) states_of_interest=c("CA","NV","WA","OR","AZ") regioncode="west-coast-AZ-NV" census_key <- Sys.getenv("CENSUS_API_KEY") if(census_key != "") { tidycensus::census_api_key(key = census_key) } dest <- states_of_interest output_dir <- file.path("model_output", paste0(paste(dest, collapse="+"),"_", as.Date(Sys.Date())))
setup_res <- covidImportation::setup_importations(dest=dest, dest_type=c("state"), #,"city","airport", "country"), dest_country="USA", dest_aggr_level=c("airport"), #, "city", "state", "country", "metro"), first_date = ISOdate(2019,12,1), last_date = Sys.time(), output_dir = output_dir, save_case_data=TRUE, get_travel=TRUE, n_top_dests=Inf, travel_dispersion=3, param_list=list(incub_mean_log=log(5.89), incub_sd_log=log(1.74), inf_period_nohosp_mean=15, inf_period_nohosp_sd=5, inf_period_hosp_mean_log=1.23, inf_period_hosp_sd_log=0.79, p_report_source=c(0.05, 0.25), shift_incid_days=-10, delta=1))
sim_res <- covidImportation::run_importations( n_sim=10, cores=5, get_detection_time=FALSE, travel_dispersion=3, allow_travel_variance=FALSE, print_progress=TRUE, output_dir = output_dir, param_list=list(incub_mean_log=log(5.89), incub_sd_log=log(1.74), inf_period_nohosp_mean=15, inf_period_nohosp_sd=5, inf_period_hosp_mean_log=1.23, inf_period_hosp_sd_log=0.79, p_report_source=c(0.05, 0.25)))
run_full_distrib_imports(states_of_interest=states_of_interest, regioncode=regioncode, yr=2010, mean_travel_file = file.path(output_dir, "travel_mean.csv"), travelers_threshold=10000, airport_cluster_threshold=80, shapefile_path = file.path("data", regioncode, "shp", paste0("counties_2010_", regioncode, ".shp")), model_output_dir = output_dir, local_dir="data/", plot=FALSE, cores=5, n_sim=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.