-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpace.Rmd
826 lines (711 loc) · 48.6 KB
/
pace.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
---
title: "Explore Pace"
description: |
How fast are we distributing COVID-19 Vaccines? <ul class="list-inline title-nav">
<li class="list-inline-item-nav"><div class = "go-to-nav" >Go to: </div></li>
<li class="list-inline-item-nav">
<a href="providers.html"> <button type="button" class="btn btn-outline-light mb-2"> Providers </button>
</a>
</li>
<li class="list-inline-item-nav">
<a href="equity.html"> <button type="button" class="btn btn-outline-light mb-2"> Equity </button>
</a>
</li>
</ul>
output:
distill::distill_article:
toc: true
css: pace_header.css
---
```{r setup, include=FALSE}
knitr::opts_chunk$set()
library(gt)
library(tidyverse)
library(ggforce)
library(highcharter)
library(readxl)
library(janitor)
library(reactable)
library(htmltools)
library(tippy)
library(lbjdata)
library(zoo)
today <- Sys.Date()
today_lbl <- format(Sys.Date(), format = "%b %d, %Y")
time_lbl <- format(Sys.time(), format = "%I:%M %p")
src <- "https://dshs.texas.gov/immunize/covid19/COVID-19-Vaccine-Data-by-County.xls" # URL For Daily COVID Data
lcl <- basename(src)
filepath <- paste0("raw_data/", today,"_",lcl,"x")
download.file(url = src, destfile = filepath) # Downloads The Data
src_providers <- "https://genesis.soc.texas.gov/files/accessibility/vaccineprovideraccessibilitydata.csv"
lcl_providers <- basename(src_providers)
filepath_providers <- paste0("raw_data/",today,"_",lcl_providers)
download.file(url = src_providers, destfile = filepath_providers)
with_tooltip <- function(value, tooltip, ...) {
div(style = "text-decoration: underline; text-decoration-style: dotted; cursor: help",
tippy(value, tooltip, ...))
}
bar_chart <- function(label, width = "100%", height = "16px", fill = "#005f86", background = NULL) {
bar <- div(style = list(background = fill, width = width, height = height))
chart <- div(style = list(flexGrow = 1, marginLeft = "8px", background = background), bar)
div(style = list(display = "flex", alignItems = "center"), label, chart)
}
vaccine_hc <- hc_theme_merge(
hc_theme_smpl(),
hc_theme(chart = list(backgroundColor = "#fff",
style = list(fontFamily = '"Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
fontSize = "28px", fontWeight = "bold",
color="#333f48", textTransform="initial")),
title = list(style = list(fontFamily = '"Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
fontWeight="bold",
color="#333f48"),
align = "left"),
subtitle = list(style = list(fontFamily = '"Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
color="#7d7d7d",
textTransform="initial",
fontWeight="400",
fontSize = "14px"),
align = "left"),
legend = list(align = "right",
style = list(fontFamily = '"Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif', color="#6d6d6d"),
itemStyle = list(fontFamily = '"Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif', color = '#6d6d6d'),
itemHoverStyle = list(color = 'gray'),
verticalAlign = "top"),
credits = list(style = list(color = "#8d8d8d")),
xAxis = list(labels =list(style = list(fontFamily = '"Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif', color="#2d2d2d")),
title = list(style = list(color = "#333f48", fontSize = "12px",
color="#333f48",fontWeight="500")),
gridLineWidth = 0,
gridLineColor = "#9d9d9d",
lineColor = 'rgba(0,0,0,0.7)',
minorGridLineColor = 'rgba(0,0,0,0.7)',
tickColor = "#9d9d9d",
tickWidth = 1),
yAxis = list(labels =list(style = list(fontFamily = '"Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif', color="#2d2d2d")),
title = list(style = list(color = "#333f48", fontSize = "12px",
color="#333f48",fontWeight="500")),
gridLineWidth = .5,
gridLineColor = 'rgba(0,0,0,0.15)',
lineColor = 'rgba(0,0,0,0.15)',
minorGridLineColor = 'rgba(0,0,0,0.15)',
tickColor = "#9d9d9d",
tickWidth = 2)))
library(gghighlight)
states <- tigris::states(cb=TRUE) %>%
as_tibble() %>%
clean_names() %>%
select(statefp, name) %>%
arrange(statefp) %>%
slice(1:51) %>%
mutate(name = str_replace(name, "New York", "New York State"))
```
# Pace Overview
## Texas Summary
The chart attempts to capture a holistic snapshot of multiple data points related to state's current efforts to vaccinate the population. At a high level, this chart is a single box that represents everyone in Texas aged 12 years and older. Within the box, you can see how much of is made up of eligible phases and how much of it is made up of the remaining population aged 12 years and older. And then, two lines mark the following:
* **Doses Shipped:** How many doses have been shipped compared to the entire 12+ population?
* **Persons Fully Vaccinated:** How many people have been fully vaccinated compared to the entire 12+ population?
```{r state summary, echo=FALSE, fig.width=11, layout="l-page"}
vaccine_summ <- read_excel(filepath, sheet = "By County", skip=0) %>%
clean_names() %>%
filter(county_name=="Texas") %>%
mutate(across(total_doses_allocated:population_education_and_child_care_personnel, as.numeric)) %>%
select(county_name, population_16, people_fully_vaccinated, total_doses_allocated,
starts_with("population_phase_"), population_16_64_any_medical_condition,
population_education_and_child_care_personnel) %>%
mutate(population_phase_remaining = population_16 - (population_phase_1a_healthcare_workers +
population_phase_1a_long_term_care_residents +
population_16_64_any_medical_condition +
population_education_and_child_care_personnel),
remaining_box_start = population_16 - population_phase_remaining) %>%
rename(`Phase 1A - Healthcare Workers`=population_phase_1a_healthcare_workers,
`Phase 1A - Long Term Care`=population_phase_1a_long_term_care_residents,
`Phase 1B - 65+ and High Risk`=population_16_64_any_medical_condition,
`School & Child Care Personnel`=population_education_and_child_care_personnel,
`Future Phases`=population_phase_remaining) %>%
pivot_longer(cols=c(contains("Phase"), "School & Child Care Personnel"), names_to = "phase_pop_est", values_to = "value") %>%
mutate(order = case_when(
phase_pop_est == "Phase 1A - Healthcare Workers" ~ 1,
phase_pop_est == "Phase 1A - Long Term Care" ~ 2,
phase_pop_est == "Phase 1B - 65+ and High Risk" ~ 3,
phase_pop_est == "School & Child Care Personnel" ~ 4,
phase_pop_est == "Future Phases" ~ 5
)) %>%
arrange(order) %>%
mutate(
prev_1 = lag(value, 1),
prev_2 = lag(value, 2),
prev_3 = lag(value, 3),
prev_1 = replace_na(prev_1, 0),
prev_2 = replace_na(prev_2, 0),
prev_3 = replace_na(prev_3, 0)) %>%
mutate(lab_pos = (value/2) + (prev_1 + prev_2 + prev_3))
box_start <- unique(vaccine_summ$remaining_box_start)
box_end <- unique(vaccine_summ$population_16)
fully_vac_lbl <- scales::comma(unique(vaccine_summ$people_fully_vaccinated), scale = .000001, accuracy = 0.01, suffix = "m")
shipped_lbl <- scales::comma(unique(vaccine_summ$total_doses_allocated), scale = .000001, accuracy = 0.01, suffix = "m")
fully_vac_xend <- unique(vaccine_summ$people_fully_vaccinated)
shipped_xend <- unique(vaccine_summ$total_doses_allocated)
vaccine_summ %>%
ggplot() +
geom_col(data = . %>% slice(1), aes(y=county_name, x=population_16), fill = "#333f48", alpha = .05) +
geom_col(data = vaccine_summ, aes(y=county_name, x=value, fill = reorder(phase_pop_est,desc(order))), alpha=.8) +
# annotate(geom = "rect", alpha = 0, color = "#333f48", linetype = 2,
# xmin = box_start, xmax = box_end, ymin = .55, ymax = 1.45) +
geom_text(data = . %>% filter(phase_pop_est != "Future Phases"), angle=90, color="white", size = 3, family = "Graphik-Semibold",
aes(y=county_name, x=lab_pos, label = reorder(phase_pop_est,desc(order)))) +
geom_text(data = vaccine_summ %>% filter(phase_pop_est == "Future Phases"), color="#2d2d2d", size = 6, hjust = 0.35,
family = "Graphik-Semibold", aes(y=county_name, x=lab_pos), label = "Phase 1C + Pop. (12+)") +
geom_vline(aes(xintercept=total_doses_allocated), linetype = 2, size = .9, color = "#2d2d2d") +
geom_vline(aes(xintercept=people_fully_vaccinated), linetype = 2, size = .9, color = "#2d2d2d") +
scale_x_continuous(labels = scales::unit_format(unit = "M", accuracy = 1, scale = 1e-6)) +
scale_fill_manual(values = c("#d6d2c4","#333f48","#005f86", "#9cadb7","#bf5700")) +
guides(fill=guide_legend(title = "Legend",
keyheight = .8)) +
annotate(
geom = "curve", color = "#2d2d2d", x = shipped_xend*.85, y = 1.55, xend = shipped_xend*.99, yend = 1.5,
curvature = -.1, arrow = arrow(length = unit(2, "mm"))
) +
annotate(geom = "label", x = shipped_xend*.65, y = 1.53, color = "#2d2d2d",
label = glue::glue("Doses Shipped: {shipped_lbl}"), family = "Graphik", hjust = "left") +
annotate(
geom = "curve", color = "#2d2d2d", x = fully_vac_xend*1.55, y = .48, xend = fully_vac_xend*1.05, yend = .54 ,
curvature = -0.1, arrow = arrow(length = unit(2, "mm"))
) +
annotate(geom = "label", x = fully_vac_xend*1.54, y = .48, color = "#2d2d2d",
label = glue::glue("Persons Fully Vacinated: {fully_vac_lbl}"), family = "Graphik", hjust = "left") +
theme_minimal(base_family = "Graphik") +
theme(plot.title = element_text(family = "Graphik-Bold", color = "#333f48", size =20),
plot.subtitle = element_text(family = "Graphik-Regular", color = "#333f48", margin = margin(b=15)),
panel.grid.major.y = element_blank(),
plot.margin = margin(t=15, r=15, b=10, l = 15),
axis.text.y = element_blank(),
legend.position = "none") +
labs(title = "Texas Summary of Vaccination Progress",
subtitle = paste0("Source: Texas Department of State Health Services. Last pulled on ", today_lbl, " at ", time_lbl),
x = NULL,
y = NULL,
color = NULL,
caption = "Data File: 'Accessible Vaccine Dashboard Data'\nLink: https://dshs.texas.gov/immunize/covid19/COVID-19-Vaccine-Data-by-County.xls\nChart by: @mrworthington")
ggsave(paste0("figures/",today,"_","tx_vaccine_summary.png"), dpi = 300, width = 11, height = 4.5)
```
```{r daily-dose-chart-all, echo=FALSE, fig.height=18, layout="l-page"}
library(quantmod)
vaccine_summ_daily_tot <- read_excel(filepath, sheet = 4, skip=0, col_types = c("text", "date", "numeric")) %>%
clean_names() %>%
filter(age_group!="Grand Total") %>%
group_by(date=vaccination_date) %>%
summarise(daily_doses = sum(doses_administered)) %>%
mutate(date=as.Date(date)) %>%
mutate(new_doses_7_day_avg= rollmean(daily_doses, 7, fill =0,
align = "right")) %>%
mutate(date = as.Date(date, format("%b %d %Y"))) %>%
ungroup() %>%
drop_na()
vaccine_summ_daily <- read_excel(filepath, sheet = 4, skip=0, col_types = c("text", "date", "numeric")) %>%
clean_names() %>%
filter(age_group!="Grand Total") %>%
group_by(age_group,date=vaccination_date) %>%
arrange(age_group) %>%
summarise(daily_doses = sum(doses_administered)) %>%
mutate(date=as.Date(date)) %>%
mutate(new_doses_7_day_avg= rollmean(daily_doses, 7, fill =0,
align = "right")) %>%
mutate(date = as.Date(date, format("%b %d %Y"))) %>%
ungroup() %>%
drop_na()
hcoptslang <- getOption("highcharter.lang")
hcoptslang$thousandsSep <- ","
options(highcharter.lang = hcoptslang)
myMenuItems <- c("downloadCSV", "downloadXLS","separator", "downloadPNG", "downloadJPEG", "downloadPDF", "downloadSVG")
highchart(type = "stock") %>%
hc_add_series(vaccine_summ_daily, type = "column", hcaes(x = date, y = daily_doses, group = age_group),
tooltip = list(pointFormat = "{point.age_group}: {point.daily_doses:,.0f}")) %>%
hc_add_series(vaccine_summ_daily_tot, type = "area", hcaes(x = date, y = new_doses_7_day_avg),
tooltip = list(pointFormat = "7-Day Avg.: {point.new_doses_7_day_avg:,.0f}"),
color = "#bf5700", name="7-Day Avg.") %>%
hc_plotOptions(area = list(fillOpacity=.1),
series = list(stacking = "normal")) %>%
hc_title(
text ="Daily Administered Doses - Texas",
useHTML = TRUE) %>%
hc_subtitle(
text =paste0("Shown are the number of reported daily administered doses across the state of Texas and the 7-day average of daily adminsitered doses. Data last pulled on ",today_lbl," at ", time_lbl,".<br>LEGEND - <span style='color: #bf5700'>7-DAY ROLLING AVG.</span>"),
useHTML = TRUE) %>%
hc_yAxis(title = list(text ="New Doses Administered Per Day", style = list(color = "#333f48", fontSize = "12px",
color="#333f48",fontWeight="500")),
min = min(vaccine_summ_daily_tot$daily_doses),
max = max(vaccine_summ_daily_tot$daily_doses),
labels =list(style = list(fontFamily = '"Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif', color="#2d2d2d"))) %>%
# hc_xAxis(title=NULL,
# plotLines=plotLines) %>%
hc_tooltip(table = TRUE, sort = TRUE,
pointFormat = "<b>{point.name}</b>
New Doses: {point.y:,.0f}") %>%
hc_colors(colors = list('#1170aa', '#c85200','#ffbc79','#57606c','#5fa2ce')) %>%
hc_legend(enabled=TRUE) %>%
hc_credits(
enabled = TRUE,
text = "Source: Texas DSHS - COVID-19 Accessible Vaccine Dashboard Data",
href = "https://dshs.texas.gov/immunize/covid19/COVID-19-Vaccine-Data-by-County.xls") %>%
hc_add_theme(lbjdata::hc_theme_lbj()) %>%
hc_rangeSelector(allButtonsEnabled= FALSE, enabled = TRUE,
verticalAlign = "top",
selected = 3, inputBoxBorderColor= 'white') %>%
hc_exporting(enabled=TRUE, scale=2, sourceHeight = 900,allowHTML = TRUE)
```
<!-- ## National Comparison -->
```{r ggplot2 national comparison, eval=FALSE, fig.height=4.5, fig.width=11, message=FALSE, warning=FALSE, include=FALSE, layout="l-page"}
library(RSocrata)
cdc_data <- read_csv("https://data.cdc.gov/resource/unsk-b7fc.csv")
cdc_vaccine_summary <- read.socrata("https://data.cdc.gov/resource/unsk-b7fc.csv") |>
filter(date==as.Date(max(date))) |>
select(date:location, contains("100k"), contains("pct"))
# cdc_last_update <- "May 10, 2021"
# cdc_last_time <- "6:00AM"
#
# cdc_vaccine_summary <- read_csv("raw_data/covid19_vaccinations_in_the_united_states-14.csv",
# skip = 2, na = "N/A") %>%
# clean_names() %>%
# select(area=state_territory_federal_entity, contains("_per_100k"), starts_with("percent"), -contains("18")) %>%
# drop_na(doses_delivered_per_100k)
cdc_vaccine_summary_ggplot2 <- cdc_vaccine_summary %>%
mutate_at(vars(contains("_per_100k")), as.numeric) %>%
filter(area %in% states$name) %>%
pivot_longer(cols=2:ncol(.),
names_to = "indicator",
values_to = "value") %>%
group_by(indicator) %>%
mutate(rank = dense_rank(desc(value))) %>%
mutate(indicator = str_replace(indicator,"doses_administered_per_100k_of_65_pop_by_state_where_administered","Administered Per 100k (Age 65+ Where Administered)"),
indicator = str_replace(indicator,"doses_administered_per_100k_by_state_where_administered","Administered Per 100k (Where Administered)"),
indicator = str_replace(indicator,"doses_delivered_per_100k_of_65_pop","Delivered Per 100k (Age 65+)"),
indicator = str_replace(indicator,"doses_delivered_per_100k","Delivered Per 100k"),
indicator = str_replace(indicator,"percent_of_total_pop_with_at_least_one_dose_by_state_of_residence","At Least 1 Dose (% of Residents)"),
indicator = str_replace(indicator,"percent_of_total_pop_fully_vaccinated_by_state_of_residence","Fully Vaccinated (% of Residents)"),
indicator = str_replace(indicator,"percent_of_total_pop_with_1_doses_by_state_of_residence","With 1 Dose (% of Residents)"),
indicator = str_replace(indicator,"percent_of_total_pop_with_2_doses_by_state_of_residence","With 2 Doses (% of Residents)"),
indicator = str_replace(indicator,"percent_of_65_pop_with_at_least_one_dose_by_state_of_residence","At Least 1 Dose (% of Residents Age 65+)"),
indicator = str_replace(indicator,"percent_of_65_pop_fully_vaccinated_by_state_of_residence","Fully Vaccinated (% of Residents Age 65+)")) %>%
filter(str_detect(indicator, "Delivered|Administered")) %>%
ungroup()
cdc_vaccine_summary_ggplot2 %>%
filter(indicator == "Administered Per 100k (Where Administered)") %>%
ggplot(aes(x=reorder(area, desc(value)), y=value, fill = value)) +
geom_bar(stat = "identity") +
geom_point(aes(x=reorder(area, desc(value)), y=value), shape = 21, fill = "#bf5700", color = "black", size = 10, stroke = .1) +
geom_text(angle=90, color="#ffffff", size = 3.1, family = "LibreFranklin-SemiBold",
aes(y= 1000, x=area, label = area), hjust = 0) +
gghighlight(area == "Texas") +
geom_text(data = cdc_vaccine_summary_ggplot2 %>% filter(indicator == "Administered Per 100k (Where Administered)", area != "Texas"),
angle=90, color="#2d2d2d", size = 3.1, family = "LibreFranklin-SemiBold", aes(y= 1000, x=area, label = area), hjust = 0) +
geom_point(aes(x=reorder(area, desc(value)), y=value), shape = 21, fill = "#bf5700", color = "black", size = 10, stroke = .1) +
geom_text(data = cdc_vaccine_summary_ggplot2 %>% filter(indicator == "Administered Per 100k (Where Administered)", area == "Texas"),
angle=90, color="#ffffff", size = 3.5, family = "LibreFranklin-Bold", aes(y= value, x=area, label = rank)) +
geom_text(data = cdc_vaccine_summary_ggplot2 %>% filter(indicator == "Administered Per 100k (Where Administered)", area != "Texas"),
angle=90, color="#2d2d2d", size = 3.5, family = "LibreFranklin-Bold", aes(y= value, x=area, label = rank)) +
theme_minimal(base_family = "Graphik") +
theme(plot.title = element_text(family = "Graphik-Bold", color = "#333f48", size =20),
plot.subtitle = element_text(family = "Graphik-Regular", color = "#333f48", margin = margin(b=15)),
panel.grid.major.y = element_blank(),
plot.margin = margin(t=15, r=15, b=10, l = 15),
axis.text.x = element_blank(),
axis.line.x = element_blank(),
axis.ticks.x = element_blank(),
legend.position = "none") +
# theme() +
scale_y_continuous(label = scales::comma) +
labs(title = "How Texas Vaccine Administration Stacks Up Against US States + DC",
subtitle = paste0("Shown are rankings of vaccine administration, based on the number of doses administered for every 100,000 people\nin a given state. Data is from the CDC. Data reflects reporting as of ",cdc_last_update," at ", cdc_last_time),
y = "Doses Delivered Per 100k Persons",
x = "States and DC",
caption = "Source: 'COVID Data Tracker - Vaccines', Center for Disease Control.")
ggsave(paste0("figures/",today,"_","tx_us_comparison_vaccine_administration.png"), device = "png", dpi = 300, width =11, height = 5)
```
<!-- # Daily Doses Administered -->
<!-- The following charts show data for the daily administration of vaccines across the general population of Texas as well as the different age groups reported by the Texas Department of State Health Services through their Texas Accessible Vaccine Dashboard Data. -->
<!-- ## All Age Groups {.unnumbered} -->
<!-- ## Ages 12-49 years {.unnumbered} -->
<!-- ```{r daily-dose-chart-12, echo=FALSE, layout="l-page"} -->
<!-- library(quantmod) -->
<!-- vaccine_summ_daily <- read_excel(filepath, sheet = 4, skip=0, col_types = c("text", "date", "numeric")) %>% -->
<!-- clean_names() %>% -->
<!-- filter(age_group=="12-49 years") %>% -->
<!-- group_by(date=vaccination_date) %>% -->
<!-- summarise(daily_doses = sum(doses_administered)) %>% -->
<!-- mutate(date=as.Date(date)) %>% -->
<!-- mutate(new_doses_7_day_avg= rollmean(daily_doses, 7, fill =0, -->
<!-- align = "right")) %>% -->
<!-- mutate(date = as.Date(date, format("%b %d %Y"))) %>% -->
<!-- ungroup() %>% -->
<!-- drop_na() -->
<!-- hcoptslang <- getOption("highcharter.lang") -->
<!-- hcoptslang$thousandsSep <- "," -->
<!-- options(highcharter.lang = hcoptslang) -->
<!-- myMenuItems <- c("downloadCSV", "downloadXLS","separator", "downloadPNG", "downloadJPEG", "downloadPDF", "downloadSVG") -->
<!-- highchart(type = "stock") %>% -->
<!-- hc_add_series(vaccine_summ_daily, type = "column", hcaes(x = date, y = daily_doses), -->
<!-- tooltip = list(pointFormat = "Daily Doses Administered: {point.daily_doses:,.0f}"), -->
<!-- color = "#333f48", name="Daily Doses Administered") %>% -->
<!-- hc_add_series(vaccine_summ_daily, type = "area", hcaes(x = date, y = new_doses_7_day_avg), -->
<!-- tooltip = list(pointFormat = "7-Day Avg.: {point.new_doses_7_day_avg:,.0f}"), -->
<!-- color = "#bf5700", name="7-Day Avg.") %>% -->
<!-- hc_plotOptions(area = list(fillOpacity=.1)) %>% -->
<!-- hc_title( -->
<!-- text ="Daily Administered Doses - 12 to 49 Years", -->
<!-- useHTML = TRUE) %>% -->
<!-- hc_subtitle( -->
<!-- text ="Shown are the number of reported daily administered doses across the state of Texas and the 7-day average of daily adminsitered doses. LEGEND - <span style='color: #bf5700'>7-DAY ROLLING AVG.</span>", -->
<!-- useHTML = TRUE) %>% -->
<!-- hc_yAxis(title = list(text ="New Doses Administered Per Day", style = list(color = "#333f48", fontSize = "12px", -->
<!-- color="#333f48",fontWeight="500")), -->
<!-- min = min(vaccine_summ_daily$daily_doses), -->
<!-- max = max(vaccine_summ_daily$daily_doses), -->
<!-- labels =list(style = list(fontFamily = '"Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif', color="#2d2d2d"))) %>% -->
<!-- # hc_xAxis(title=NULL, -->
<!-- # plotLines=plotLines) %>% -->
<!-- # hc_tooltip(table = TRUE, sort = TRUE, -->
<!-- # pointFormat = "<b>{point.name}</b><br> -->
<!-- # New Doses: {point.y:,.0f}") %>% -->
<!-- hc_legend(enabled=FALSE) %>% -->
<!-- hc_credits( -->
<!-- enabled = TRUE, -->
<!-- text = "Source: Texas DSHS - COVID-19 Accessible Vaccine Dashboard Data", -->
<!-- href = "https://dshs.texas.gov/immunize/covid19/COVID-19-Vaccine-Data-by-County.xls") %>% -->
<!-- hc_add_theme(lbjdata::hc_theme_lbj()) %>% -->
<!-- hc_rangeSelector(allButtonsEnabled= FALSE, enabled = TRUE, -->
<!-- verticalAlign = "top", -->
<!-- selected = 3, inputBoxBorderColor= 'white') -->
<!-- ``` -->
<!-- ## Ages 50-64 years {.unlisted} -->
<!-- ```{r daily-dose-chart-50, echo=FALSE, layout="l-page"} -->
<!-- library(quantmod) -->
<!-- vaccine_summ_daily <- read_excel(filepath, sheet = 4, skip=0, col_types = c("text", "date", "numeric")) %>% -->
<!-- clean_names() %>% -->
<!-- filter(age_group=="50-64 years") %>% -->
<!-- group_by(date=vaccination_date) %>% -->
<!-- summarise(daily_doses = sum(doses_administered)) %>% -->
<!-- mutate(date=as.Date(date)) %>% -->
<!-- mutate(new_doses_7_day_avg= rollmean(daily_doses, 7, fill =0, -->
<!-- align = "right")) %>% -->
<!-- mutate(date = as.Date(date, format("%b %d %Y"))) %>% -->
<!-- ungroup() %>% -->
<!-- drop_na() -->
<!-- hcoptslang <- getOption("highcharter.lang") -->
<!-- hcoptslang$thousandsSep <- "," -->
<!-- options(highcharter.lang = hcoptslang) -->
<!-- myMenuItems <- c("downloadCSV", "downloadXLS","separator", "downloadPNG", "downloadJPEG", "downloadPDF", "downloadSVG") -->
<!-- highchart(type = "stock") %>% -->
<!-- hc_add_series(vaccine_summ_daily, type = "column", hcaes(x = date, y = daily_doses), -->
<!-- tooltip = list(pointFormat = "Daily Doses Administered: {point.daily_doses:,.0f}"), -->
<!-- color = "#333f48", name="Daily Doses Administered") %>% -->
<!-- hc_add_series(vaccine_summ_daily, type = "area", hcaes(x = date, y = new_doses_7_day_avg), -->
<!-- tooltip = list(pointFormat = "7-Day Avg.: {point.new_doses_7_day_avg:,.0f}"), -->
<!-- color = "#bf5700", name="7-Day Avg.") %>% -->
<!-- hc_plotOptions(area = list(fillOpacity=.1)) %>% -->
<!-- hc_title( -->
<!-- text ="Daily Administered Doses - 50 to 64 years", -->
<!-- useHTML = TRUE) %>% -->
<!-- hc_subtitle( -->
<!-- text ="Shown are the number of reported daily administered doses across the state of Texas and the 7-day average of daily adminsitered doses. LEGEND - <span style='color: #bf5700'>7-DAY ROLLING AVG.</span>", -->
<!-- useHTML = TRUE) %>% -->
<!-- hc_yAxis(title = list(text ="New Doses Administered Per Day", style = list(color = "#333f48", fontSize = "12px", -->
<!-- color="#333f48",fontWeight="500")), -->
<!-- min = min(vaccine_summ_daily$daily_doses), -->
<!-- max = max(vaccine_summ_daily$daily_doses), -->
<!-- labels =list(style = list(fontFamily = '"Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif', color="#2d2d2d"))) %>% -->
<!-- # hc_xAxis(title=NULL, -->
<!-- # plotLines=plotLines) %>% -->
<!-- # hc_tooltip(table = TRUE, sort = TRUE, -->
<!-- # pointFormat = "<b>{point.name}</b><br> -->
<!-- # New Doses: {point.y:,.0f}") %>% -->
<!-- hc_legend(enabled=FALSE) %>% -->
<!-- hc_credits( -->
<!-- enabled = TRUE, -->
<!-- text = "Source: Texas DSHS - COVID-19 Accessible Vaccine Dashboard Data", -->
<!-- href = "https://dshs.texas.gov/immunize/covid19/COVID-19-Vaccine-Data-by-County.xls") %>% -->
<!-- hc_add_theme(lbjdata::hc_theme_lbj()) %>% -->
<!-- hc_rangeSelector(allButtonsEnabled= FALSE, enabled = TRUE, -->
<!-- verticalAlign = "top", -->
<!-- selected = 3, inputBoxBorderColor= 'white') -->
<!-- ``` -->
<!-- ## Ages 65-79 years {.unlisted} -->
<!-- ```{r daily-dose-chart-65, echo=FALSE, layout="l-page"} -->
<!-- library(quantmod) -->
<!-- vaccine_summ_daily <- read_excel(filepath, sheet = 4, skip=0, col_types = c("text", "date", "numeric")) %>% -->
<!-- clean_names() %>% -->
<!-- filter(age_group=="65-79 years") %>% -->
<!-- group_by(date=vaccination_date) %>% -->
<!-- summarise(daily_doses = sum(doses_administered)) %>% -->
<!-- mutate(date=as.Date(date)) %>% -->
<!-- mutate(new_doses_7_day_avg= rollmean(daily_doses, 7, fill =0, -->
<!-- align = "right")) %>% -->
<!-- mutate(date = as.Date(date, format("%b %d %Y"))) %>% -->
<!-- ungroup() %>% -->
<!-- drop_na() -->
<!-- hcoptslang <- getOption("highcharter.lang") -->
<!-- hcoptslang$thousandsSep <- "," -->
<!-- options(highcharter.lang = hcoptslang) -->
<!-- myMenuItems <- c("downloadCSV", "downloadXLS","separator", "downloadPNG", "downloadJPEG", "downloadPDF", "downloadSVG") -->
<!-- highchart(type = "stock") %>% -->
<!-- hc_add_series(vaccine_summ_daily, type = "column", hcaes(x = date, y = daily_doses), -->
<!-- tooltip = list(pointFormat = "Daily Doses Administered: {point.daily_doses:,.0f}"), -->
<!-- color = "#333f48", name="Daily Doses Administered") %>% -->
<!-- hc_add_series(vaccine_summ_daily, type = "area", hcaes(x = date, y = new_doses_7_day_avg), -->
<!-- tooltip = list(pointFormat = "7-Day Avg.: {point.new_doses_7_day_avg:,.0f}"), -->
<!-- color = "#bf5700", name="7-Day Avg.") %>% -->
<!-- hc_plotOptions(area = list(fillOpacity=.1)) %>% -->
<!-- hc_title( -->
<!-- text ="Daily Administered Doses - 65 to 79", -->
<!-- useHTML = TRUE) %>% -->
<!-- hc_subtitle( -->
<!-- text ="Shown are the number of reported daily administered doses across the state of Texas and the 7-day average of daily adminsitered doses. LEGEND - <span style='color: #bf5700'>7-DAY ROLLING AVG.</span>", -->
<!-- useHTML = TRUE) %>% -->
<!-- hc_yAxis(title = list(text ="New Doses Administered Per Day", style = list(color = "#333f48", fontSize = "12px", -->
<!-- color="#333f48",fontWeight="500")), -->
<!-- min = min(vaccine_summ_daily$daily_doses), -->
<!-- max = max(vaccine_summ_daily$daily_doses), -->
<!-- labels =list(style = list(fontFamily = '"Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif', color="#2d2d2d"))) %>% -->
<!-- # hc_xAxis(title=NULL, -->
<!-- # plotLines=plotLines) %>% -->
<!-- # hc_tooltip(table = TRUE, sort = TRUE, -->
<!-- # pointFormat = "<b>{point.name}</b><br> -->
<!-- # New Doses: {point.y:,.0f}") %>% -->
<!-- hc_legend(enabled=FALSE) %>% -->
<!-- hc_credits( -->
<!-- enabled = TRUE, -->
<!-- text = "Source: Texas DSHS - COVID-19 Accessible Vaccine Dashboard Data", -->
<!-- href = "https://dshs.texas.gov/immunize/covid19/COVID-19-Vaccine-Data-by-County.xls") %>% -->
<!-- hc_add_theme(lbjdata::hc_theme_lbj()) %>% -->
<!-- hc_rangeSelector(allButtonsEnabled= FALSE, enabled = TRUE, -->
<!-- verticalAlign = "top", -->
<!-- selected = 3, inputBoxBorderColor= 'white') -->
<!-- ``` -->
<!-- ## Ages 80 years or older {.unlisted} -->
<!-- ```{r daily-dose-chart-80, echo=FALSE, layout="l-page"} -->
<!-- library(quantmod) -->
<!-- vaccine_summ_daily <- read_excel(filepath, sheet = 4, skip=0, col_types = c("text", "date", "numeric")) %>% -->
<!-- clean_names() %>% -->
<!-- filter(age_group=="80+ years") %>% -->
<!-- group_by(date=vaccination_date) %>% -->
<!-- summarise(daily_doses = sum(doses_administered)) %>% -->
<!-- mutate(date=as.Date(date)) %>% -->
<!-- mutate(new_doses_7_day_avg= rollmean(daily_doses, 7, fill =0, -->
<!-- align = "right")) %>% -->
<!-- mutate(date = as.Date(date, format("%b %d %Y"))) %>% -->
<!-- ungroup() %>% -->
<!-- drop_na() -->
<!-- hcoptslang <- getOption("highcharter.lang") -->
<!-- hcoptslang$thousandsSep <- "," -->
<!-- options(highcharter.lang = hcoptslang) -->
<!-- myMenuItems <- c("downloadCSV", "downloadXLS","separator", "downloadPNG", "downloadJPEG", "downloadPDF", "downloadSVG") -->
<!-- highchart(type = "stock") %>% -->
<!-- hc_add_series(vaccine_summ_daily, type = "column", hcaes(x = date, y = daily_doses), -->
<!-- tooltip = list(pointFormat = "Daily Doses Administered: {point.daily_doses:,.0f}"), -->
<!-- color = "#333f48", name="Daily Doses Administered") %>% -->
<!-- hc_add_series(vaccine_summ_daily, type = "area", hcaes(x = date, y = new_doses_7_day_avg), -->
<!-- tooltip = list(pointFormat = "7-Day Avg.: {point.new_doses_7_day_avg:,.0f}"), -->
<!-- color = "#bf5700", name="7-Day Avg.") %>% -->
<!-- hc_plotOptions(area = list(fillOpacity=.1)) %>% -->
<!-- hc_title( -->
<!-- text ="Daily Administered Doses - 80 years or older", -->
<!-- useHTML = TRUE) %>% -->
<!-- hc_subtitle( -->
<!-- text ="Shown are the number of reported daily administered doses across the state of Texas and the 7-day average of daily adminsitered doses. LEGEND - <span style='color: #bf5700'>7-DAY ROLLING AVG.</span>", -->
<!-- useHTML = TRUE) %>% -->
<!-- hc_yAxis(title = list(text ="New Doses Administered Per Day", style = list(color = "#333f48", fontSize = "12px", -->
<!-- color="#333f48",fontWeight="500")), -->
<!-- min = min(vaccine_summ_daily$daily_doses), -->
<!-- max = max(vaccine_summ_daily$daily_doses), -->
<!-- labels =list(style = list(fontFamily = '"Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif', color="#2d2d2d"))) %>% -->
<!-- # hc_xAxis(title=NULL, -->
<!-- # plotLines=plotLines) %>% -->
<!-- # hc_tooltip(table = TRUE, sort = TRUE, -->
<!-- # pointFormat = "<b>{point.name}</b><br> -->
<!-- # New Doses: {point.y:,.0f}") %>% -->
<!-- hc_legend(enabled=FALSE) %>% -->
<!-- hc_credits( -->
<!-- enabled = TRUE, -->
<!-- text = "Source: Texas DSHS - COVID-19 Accessible Vaccine Dashboard Data", -->
<!-- href = "https://dshs.texas.gov/immunize/covid19/COVID-19-Vaccine-Data-by-County.xls") %>% -->
<!-- hc_add_theme(lbjdata::hc_theme_lbj()) %>% -->
<!-- hc_rangeSelector(allButtonsEnabled= FALSE, enabled = TRUE, -->
<!-- verticalAlign = "top", -->
<!-- selected = 3, inputBoxBorderColor= 'white') -->
<!-- ``` -->
<!-- # Vaccine Hesitancy -->
<!-- Recently, the U.S. Department of Health and Human Services began publishing predicted estimates for vaccine hesitancy across the United States across different geographies in the US. -->
```{r eval=FALSE, include=FALSE}
library(mapview)
vax_hesitancy <- RSocrata::read.socrata("https://data.cdc.gov/resource/djj9-kh3p.csv")
```
# Distribution Trends
The next chart captures where the reported supply of doses has been distributed, by the type of vaccine provider. The state classifies provider types, which allows to see very simply: what kinds of providers have recently received shipments of doses and how much were they shipped?
**Note as of Mar 31**: The chart showing how much DSHS has shipped to each provider type across Texas has been temporarily removed due to the fact that DSHS appears to have stopped publishing a column showing how much was shipped to each provider in their daily updates of the ["Texas Vaccine Provider Data"](https://genesis.soc.texas.gov/files/accessibility/vaccineprovideraccessibilitydata.csv).
```{r eval=FALSE, fig.width=10, include=FALSE, layout="l-page"}
supply_by_provider_type <- read_csv(filepath_providers, skip=0) %>%
janitor::clean_names() %>%
group_by(type) %>%
summarise(tot_shipped = sum(total_shipped),
tot_avail = sum(vaccines_available))
supply_by_provider_type %>%
drop_na() %>%
ggplot(aes(x=reorder(type, desc(tot_shipped)), y = tot_shipped, fill=type)) +
geom_col() +
theme_minimal(base_family = "Graphik") +
geom_text(angle=90, color="#2d2d2d", size = 3.1, family = "Graphik-Semibold",
aes(y= 0, x=type, label = type), hjust = 0) +
scale_y_continuous(labels = scales::unit_format(unit = "K", accuracy = 1, scale = 1e-3)) +
ggthemes::scale_fill_tableau(palette = "Tableau 20") +
theme(plot.title = element_text(family = "Graphik-Bold", color = "#333f48", size =20),
plot.subtitle = element_text(family = "Graphik-Regular", color = "#333f48", margin = margin(b=15)),
panel.grid.major.y = element_blank(),
plot.margin = margin(t=15, r=15, b=10, l = 15),
axis.text.x = element_blank(),
legend.position = "none") +
labs(title = "Reported Total Supply by Provider Type",
subtitle = paste0("Source: Texas Department of State Health Services. Last pulled on ", today_lbl, " at ", time_lbl),
x = NULL,
y = "Doses (Shipped)",
color = NULL,
caption = "Data File: 'Texas Vaccine Provider Data'\nLink: https://genesis.soc.texas.gov/files/accessibility/vaccineprovideraccessibilitydata.csv\nChart by: @mrworthington") #+
# ggsave(paste0("figures/",today,"_","supply_by_provider_type.png"), dpi = 300, width = 11, height = 4.5)
```
Similar to the last one, this chart focuses on reported availability. In other words, how much of the shipped doses are provider types reporting to be still available at the time the chart was generated?
```{r echo=FALSE, fig.width=10, layout="l-page"}
supply_by_provider_type <- read_csv(filepath_providers, skip=0) %>%
janitor::clean_names() %>%
group_by(type) %>%
summarise(tot_avail = sum(vaccines_available))
supply_by_provider_type %>%
drop_na() %>%
ggplot(aes(x=reorder(type, desc(tot_avail)), y = tot_avail, fill=type)) +
geom_col() +
theme_minimal(base_family = "Graphik") +
geom_text(angle=90, color="#2d2d2d", size = 3.1, family = "Graphik-Semibold",
aes(y= 0, x=type, label = type), hjust = 0) +
scale_y_continuous(labels = scales::unit_format(unit = "K", accuracy = 1, scale = 1e-3)) +
ggthemes::scale_fill_tableau(palette = "Tableau 20") +
theme(plot.title = element_text(family = "Graphik-Bold", color = "#333f48", size =20),
plot.subtitle = element_text(family = "Graphik-Regular", color = "#333f48", margin = margin(b=15)),
panel.grid.major.y = element_blank(),
plot.margin = margin(t=15, r=15, b=10, l = 15),
axis.text.x = element_blank(),
legend.position = "none") +
labs(title = "Reported Availability by Provider Type",
subtitle = paste0("Source: Texas Department of State Health Services. Last pulled on ", today_lbl, " at ", time_lbl),
x = NULL,
y = "Doses (Available)",
color = NULL,
caption = "Data File: 'Texas Vaccine Provider Data'\nLink: https://genesis.soc.texas.gov/files/accessibility/vaccineprovideraccessibilitydata.csv\nChart by: @mrworthington") #+
# ggsave(paste0("figures/",today,"_","availability_by_provider_type.png"), dpi = 300, width = 11, height = 4.5)
```
<!-- <details class = "l-body"> -->
<!-- <summary><strong>Notes about the table below</strong></summary> -->
<!-- * Data shown below comes from the "Accessible Vaccine Dashboard Data" published by the Texas Department of State Health Services, which can be found at this link: `r src` -->
<!-- * It was last pulled on `r today_lbl` at `r time_lbl` -->
<!-- </details> -->
<!-- <details class = "l-body"> -->
<!-- <summary><strong> Data dictionary for the table below </strong></summary> -->
<!-- * **County**: This comes from the DSHS "Accessible Vaccine Dashboard Data" file and represents the county for which DSHS has collected data. -->
<!-- * **Popuplation (12+)"**: This comes from the DSHS "Accessible Vaccine Dashboard Data" file and represents the number of persons aged 12 years and older in Texas. This number is reported given that vaccines authorized for emergency use have only authorized for use in persons aged 12 years and older. -->
<!-- * **Total Doses Allocated**: This comes from the DSHS "Accessible Vaccine Dashboard Data" file and represents the number of total doses allocated/shipped to a given Texas county. -->
<!-- * **Full Vaccinations**: This comes from the DSHS "Accessible Vaccine Dashboard Data" file and represents the number of persons who are fully vaccinated in a given Texas county. -->
<!-- * **Doses Allocated (Per Capita)**: This is a custom calculation that is derived by taking the number of total doses allocated and dividing it by the population aged 12 years and older, both numbers provided by DSHS. The result of that is then multipled by 100,000 for standardization and rounded up. -->
<!-- * **Full Vaccinations (Per Capita)**: This is a custom calculation that is derived by taking the number of persons who are fully vaccinated and dividing it by the population aged 12 years and older, both numbers provided by DSHS. The result of that is then multipled by 100,000 for standardization and rounded up. -->
<!-- </details> -->
<!-- ## Vaccine Data Table -->
```{r eval=FALSE, message=FALSE, warning=FALSE, include=FALSE, layout="l-screen-inset"}
vaccine_cnty_summ <- read_excel(filepath, sheet = "By County", skip=0) %>%
clean_names() %>%
filter(county_name!="Texas" & county_name!="Federal Long-Term Care Vaccination Program" & county_name!="*Other") %>%
select(county_name, population_16, people_fully_vaccinated, total_doses_allocated) %>%
mutate(population_16 = as.numeric(population_16),
people_fully_vaccinated = as.numeric(people_fully_vaccinated),
total_doses_allocated = as.numeric(total_doses_allocated)) %>%
mutate(doses_allocated_per_cap = round((total_doses_allocated/population_16)*100000, digits=0),
fully_vaccinated_per_cap = round((people_fully_vaccinated/population_16)*100000, digits=0)) %>%
select(county_name, population_16, total_doses_allocated, doses_allocated_per_cap, people_fully_vaccinated, fully_vaccinated_per_cap) %>%
arrange(desc(population_16))
reactable(data =vaccine_cnty_summ,
searchable = TRUE,
striped = TRUE,
highlight = TRUE,
bordered = TRUE,
pagination = TRUE,
showSortIcon = TRUE ,
defaultPageSize = 15,
resizable = TRUE,
fullWidth = TRUE,
compact = TRUE,
theme = reactableTheme(
color = "#2d2d2d",
backgroundColor = "rgba(255,255,255,1)",
borderColor = "rgba(255,255,255,.2)",
headerStyle = list(background = "#333f48",
color = "#fff",
fontWeight="700",
letterSpacing="1px",
fontSize="15px"),
highlightColor = "#9cadb7",
cellPadding = "8px 12px",
style = list(fontSize = "14px",
fontFamily = "'Libre Franklin', -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif"),
searchInputStyle = list(width = "100%")),
columns = list(
county_name = colDef(name = "County", show = TRUE, width = 110,
style = list(borderRight = "1px solid rgba(0, 0, 0, 0.1)")),
population_16 = colDef(show = TRUE, width = 180,
header = with_tooltip("Population (12+)", "Number of Persons"),
format = colFormat(separators = TRUE),
align = "center",
style = list(borderRight = "1.5px solid rgba(0, 0, 0, 0.2)")),
total_doses_allocated = colDef(show = TRUE, format = colFormat(separators = TRUE),
align = "center",
width = 250,
header = with_tooltip("Total Doses Allocated", "Number of Doses Allocated")),
doses_allocated_per_cap = colDef(show = TRUE,
header = with_tooltip("Doses Allocated (Per Capita)", "For every 100,000 persons, how many doses have been allocated to this county?"),
style = list(borderRight = "1.5px solid rgba(0, 0, 0, 0.2)", fontFamily = "Fira Code", whiteSpace = "pre"),
align = "left",
cell = function(value) {
width <- paste0(value * 100 / max(vaccine_cnty_summ$doses_allocated_per_cap, na.rm = TRUE), "%")
# Add thousands separators
value <- format(value, big.mark = ",")
# Fix each label using the width of the widest number (incl. thousands separators)
value <- format(value, width = 9, justify = "right")
bar_chart(value, width = width, fill = "#bf5700")
}),
people_fully_vaccinated = colDef(show = TRUE,
format = colFormat(separators = TRUE),
align = "center",
width = 250,
header = with_tooltip("Full Vaccinations", "Number of Persons")),
fully_vaccinated_per_cap = colDef(show = TRUE,
header = with_tooltip("Full Vaccinations (Per Capita)", "For every 100,000 persons, how many would be fully vaccinated?"),
style = list(borderRight = "1.5px solid rgba(0, 0, 0, 0.2)", fontFamily = "Fira Code", whiteSpace = "pre"),
align = "left",
cell = function(value) {
width <- paste0(value * 100 / max(vaccine_cnty_summ$fully_vaccinated_per_cap, na.rm = TRUE), "%")
value <- format(value, big.mark = ",")
# Fix each label using the width of the widest number (incl. thousands separators)
value <- format(value, width = 9, justify = "right")
bar_chart(value, width = width)
})))
```
+
# Vaccine Pace Tracker
The last tool to track the pace of distribution is an interactive comparison of the state and counties across Texas. The tool allows users to track the statewide pace of vaccine progress and the county-level pace of vaccine progress. Because the state is only focused on the population aged 12 and above, we only measure progress against this population.
<details class = "l-body">
<summary><strong>Question | </strong>Why do they only measure the population aged 12 and above?</summary>
<br>
According to [the Texas Department of State Health Services](https://dshs.texas.gov/coronavirus/immunize/vaccine-faqs.aspx#safety), "At this time, experts do not know how safe the COVID-19 vaccine is for children. People 12 years old and older are currently eligible to get the vaccine if they are in a priority population."
</details>
The two charts represent the entire populations of the state and selected county. In the boxes below, there are three indicators.
1. **Dose Distribution**: This box shows how many doses have been administered out of the doses that have actually been allocated to that entity (either the state or the selected county).
1. **Daily Average**: This is an ongoing calculation of daily averages that starts on Dec 15. The only thing it considers is how many doses are going into arms each day.
1. **When 70% is Vaccinated**: Based on that daily average and knowing most of the approved vaccines require two doses, this box tries to guesstimate when 70% of the population aged 12 and older will be vaccinated. This is not a herd immunity projection, rather a look ahead as to when most of the population aged 12 and older will likely be vaccinated.
```{r echo=FALSE, message=FALSE, warning=FALSE, layout = "l-page"}
knitr::include_app("https://mrworthington.shinyapps.io/tx_vaccine-pace/", height = "1800px")
```
## Photography Credit {.appendix}
<span>Photo by <a href="https://unsplash.com/@cdc?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">CDC</a> on <a href="https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a></span>