This data resource captures vaccine allocations, doses administered, and the number of people (as opposed to doses) to which they have been administered. As of December, 2020, this dataset is not complete.

cci_us_vaccine_data()

Value

A data.frame

Author

Sean Davis seandavi@gmail.com

Examples


vacc = cci_us_vaccine_data()
head(vacc)
#>    province_state       date vaccine_type fips country_region     lat    long_
#> 1:        Alabama 2020-12-10          All    1             US 32.3182 -86.9023
#> 2:        Alabama 2020-12-10      Moderna    1             US 32.3182 -86.9023
#> 3:        Alabama 2020-12-10       Pfizer    1             US 32.3182 -86.9023
#> 4:        Alabama 2020-12-11          All    1             US 32.3182 -86.9023
#> 5:        Alabama 2020-12-11      Moderna    1             US 32.3182 -86.9023
#> 6:        Alabama 2020-12-11       Pfizer    1             US 32.3182 -86.9023
#>    doses_alloc doses_shipped doses_admin stage_one_doses stage_two_doses
#> 1:          NA            NA          NA              NA              NA
#> 2:          NA            NA          NA              NA              NA
#> 3:          NA            NA          NA              NA              NA
#> 4:          NA            NA          NA              NA              NA
#> 5:          NA            NA          NA              NA              NA
#> 6:          NA            NA          NA              NA              NA
#>    combined_key
#> 1:  Alabama, US
#> 2:  Alabama, US
#> 3:  Alabama, US
#> 4:  Alabama, US
#> 5:  Alabama, US
#> 6:  Alabama, US


us_pop = us_population_details(geography='state', product='population', 
  year=2019)
#> Loading required namespace: tidycensus
#> Error in tidycensus::get_estimates(...): A Census API key is required.  Obtain one at http://api.census.gov/data/key_signup.html, and then supply the key to the `census_api_key()` function to use it throughout your tidycensus session.
us_pop = us_pop[us_pop$variable=='POP',]
#> Error in eval(expr, envir, enclos): object 'us_pop' not found
vac_pop = merge(us_pop,vacc,by.x="NAME",by.y="province_state")
#> Error in merge(us_pop, vacc, by.x = "NAME", by.y = "province_state"): object 'us_pop' not found

if(require('ggplot2')) {
  vac_pop[vac_pop$vaccine_type=='All' & vac_pop$stage_one_doses<1e7,] %>%
  ggplot(aes(x=date,y=stage_one_doses/value*100000, color=NAME)) +
    geom_line() + 
    ggtitle("Number of first vaccine doses delivered by state",'Cumulative counts') +
    xlab("Date") +
    ylab("Number of people vaccinated/100k population")
}
#> Error in ggplot(., aes(x = date, y = stage_one_doses/value * 1e+05, color = NAME)): object 'vac_pop' not found