R/cci_us_vaccine_data.R
cci_us_vaccine_data.Rd
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()
A data.frame
Other data-import:
acaps_government_measures_data()
,
acaps_secondary_impact_data()
,
apple_mobility_data()
,
beoutbreakprepared_data()
,
cdc_aggregated_projections()
,
cdc_excess_deaths()
,
cdc_social_vulnerability_index()
,
coronadatascraper_data()
,
coronanet_government_response_data()
,
cov_glue_lineage_data()
,
cov_glue_newick_data()
,
cov_glue_snp_lineage()
,
covidtracker_data()
,
descartes_mobility_data()
,
ecdc_data()
,
econ_tracker_consumer_spending
,
econ_tracker_employment
,
econ_tracker_unemp_data
,
economist_excess_deaths()
,
financial_times_excess_deaths()
,
google_mobility_data()
,
government_policy_timeline()
,
jhu_data()
,
jhu_us_data()
,
kff_icu_beds()
,
nytimes_county_data()
,
oecd_unemployment_data()
,
owid_data()
,
param_estimates_published()
,
test_and_trace_data()
,
us_county_geo_details()
,
us_county_health_rankings()
,
us_healthcare_capacity()
,
us_hospital_details()
,
us_state_distancing_policy()
,
usa_facts_data()
,
who_cases()
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