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 the data for the importation model.

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))

Run the Simulations

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)))

Distribute the Simulated Importations into Airports to Counties

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)


HopkinsIDD/covidImportation documentation built on Sept. 14, 2020, 2:43 p.m.