/
805_capstone_covid.Rmd
69 lines (30 loc) · 2.06 KB
/
805_capstone_covid.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
<!--
This file by Martin Monkman
is licensed under a Creative Commons Attribution 4.0 International License
https://creativecommons.org/licenses/by/4.0/
-->
# COVID-19 case numbers in British Columbia {#covid-bc}
## Introduction {#covid-bc-intro}
As the COVID-19 pandemic enters its next phase, the number of cases in British Columbia is increasing.
Here are two charts by Jens von Bergmann.
From August 25, 2020 showing cases by age group:
![BC weekly cases by age group](static/img_capstone/bc_covid_cases_age_2020-08-25.jpg){width=100%}
* https://twitter.com/vb_jens/status/1298407214189690880?s=20
From November 9, 2020 showing new cases by Health Authority region, on a "per 100K population" basis:
![BC daily cases per 100k population](static/img_capstone/bc_dailycases_per_100k.jpg){width=100%}
* https://twitter.com/vb_jens/status/1325965304925577218?s=20
For this chart, you do not have to add the vertical lines (showing).
As well, you'll need to group the three health authority regions into one. A tool for doing that is the `case_when()` function in {dplyr}:
* ["A general vectorised if"](https://dplyr.tidyverse.org/reference/case_when.html)
### Other visualizations of data from the same source
https://twitter.com/vb_jens/status/1323423179390418944?s=20
Animations:
https://twitter.com/vb_jens/status/1323649252770291713?s=20
## Going beyond
An idea for going beyond the two charts above would be to use the facet functionality of {ggplot2} to draw a separate case rate plot (similar to the data in the second chart) for each of the five health authority regions. (The plot above combines three of them into the "Other BC" line, but after the original plot was made, the case rates in some of the other regions were also high.)
* [{ggplot2} reference](https://ggplot2.tidyverse.org/reference/facet_grid.html)
* [_R Graphics Cookbook_](https://r-graphics.org/chapter-facet)
## Data source {#covid-bc-data}
Source: COVID-19 Canada Open Data Working Group
[opencovid.ca GitHub repository](https://github.com/jeanpaulrsoucy/covid-19-canada-gov-data)
-30-