Runs a GET request of summary data from the COVID-19 tracker API, and
returns parsed data.
Via the split
argument, data my be "overall" (all provinces/territories
combined), by "province" (one row per province/territory) or by "region"
(one row per health region).
Usage
get_summary(split = c("overall", "province", "region"))
Examples
get_summary()
#> # A tibble: 1 × 24
#> last_updated latest_d…¹ chang…² chang…³ chang…⁴ chang…⁵ chang…⁶ chang…⁷
#> <dttm> <date> <int> <int> <int> <int> <int> <int>
#> 1 2022-08-22 04:23:04 2022-08-22 4251 88 10820 -2 0 1863
#> # … with 16 more variables: change_vaccinations <int>, change_vaccinated <int>,
#> # change_boosters_1 <int>, change_boosters_2 <int>,
#> # change_vaccines_distributed <int>, total_cases <int>,
#> # total_fatalities <int>, total_tests <int>, total_hospitalizations <int>,
#> # total_criticals <int>, total_recoveries <int>, total_vaccinations <int>,
#> # total_vaccinated <int>, total_boosters_1 <int>, total_boosters_2 <int>,
#> # total_vaccines_distributed <int>, and abbreviated variable names …
get_summary("province")
#> # A tibble: 13 × 25
#> last_updated province date chang…¹ chang…² chang…³ chang…⁴ chang…⁵
#> <dttm> <chr> <chr> <int> <int> <int> <int> <int>
#> 1 2022-08-22 04:23:04 ON 2022-08… 1852 19 10820 -7 1
#> 2 2022-08-22 04:23:04 QC 2022-08… 0 0 0 0 0
#> 3 2022-08-22 04:23:04 NS 2022-08… 0 0 0 0 0
#> 4 2022-08-22 04:23:04 NB 2022-08… 0 0 0 0 0
#> 5 2022-08-22 04:23:04 MB 2022-08… 0 0 0 0 0
#> 6 2022-08-22 04:23:04 BC 2022-08… 875 42 0 5 -1
#> 7 2022-08-22 04:23:04 PE 2022-08… 0 0 0 0 0
#> 8 2022-08-22 04:23:04 SK 2022-08… 1524 27 0 0 0
#> 9 2022-08-22 04:23:04 AB 2022-08… 0 0 0 0 0
#> 10 2022-08-22 04:23:04 NL 2022-08… 0 0 0 0 0
#> 11 2022-08-22 04:23:04 NT 2022-08… 0 0 0 0 0
#> 12 2022-08-22 04:23:04 YT 2022-08… 0 0 0 0 0
#> 13 2022-08-22 04:23:04 NU 2022-08… 0 0 0 0 0
#> # … with 17 more variables: change_recoveries <int>, change_vaccinations <int>,
#> # change_vaccinated <int>, change_boosters_1 <int>, change_boosters_2 <int>,
#> # change_vaccines_distributed <int>, total_cases <int>,
#> # total_fatalities <int>, total_tests <int>, total_hospitalizations <int>,
#> # total_criticals <int>, total_recoveries <int>, total_vaccinations <int>,
#> # total_vaccinated <int>, total_boosters_1 <int>, total_boosters_2 <int>,
#> # total_vaccines_distributed <int>, and abbreviated variable names …
get_summary("region")
#> # A tibble: 92 × 21
#> last_updated hr_uid date total…¹ total…² total…³ total…⁴ total…⁵
#> <dttm> <int> <chr> <int> <int> <int> <int> <int>
#> 1 2022-08-22 04:23:04 1201 2022-08-10 0 1 640 NA NA
#> 2 2022-08-22 04:23:04 1202 2022-08-10 0 1 943 NA NA
#> 3 2022-08-22 04:23:04 1203 2022-08-10 0 5 947 NA NA
#> 4 2022-08-22 04:23:04 1204 2022-08-10 0 58 6344 NA NA
#> 5 2022-08-22 04:23:04 4601 2022-08-10 0 207 70610 29962 198
#> 6 2022-08-22 04:23:04 4602 2022-08-10 0 13 12897 807291 70
#> 7 2022-08-22 04:23:04 4603 2022-08-10 0 16 10619 807291 25
#> 8 2022-08-22 04:23:04 4604 2022-08-10 0 7 16959 807291 36
#> 9 2022-08-22 04:23:04 4605 2022-08-10 0 58 18253 6696 30
#> 10 2022-08-22 04:23:04 1301 2022-08-10 0 2 15766 293294 NA
#> # … with 82 more rows, 13 more variables: total_criticals <int>,
#> # total_vaccinations <int>, total_vaccinated <int>, total_boosters_1 <int>,
#> # total_boosters_2 <int>, change_vaccinations <int>, change_vaccinated <int>,
#> # change_boosters_1 <int>, change_cases <int>, change_fatalities <int>,
#> # change_hospitalizations <int>, change_criticals <int>,
#> # change_boosters_2 <int>, and abbreviated variable names ¹total_cases,
#> # ²total_fatalities, ³total_recoveries, ⁴total_tests, …