canadacovidmetricsR provides key metrics regarding COVID-19 situation in Canada across provinces using the OpenCovid API.
This package allows users to obtain key metrics on the COVID-19 situation in Canada at a national or provincial level for a specific time period. The package contains 4 functions, each of which returns a key metric relating to COVID-19 in Canada. The 4 metrics are: reported cases, reported deaths, reported recoveries, and reported vaccinations. The results returned relect both point-in-time as well as cumulative quantities. This package leverages OpenCovidAPI, which exposes reliable data to be consumed by users of this package.
There are 4 functions in this package:
get_cases
Query reported cases with ability to specify
location grouping and date range of returned data.
get_deaths
Query reported deaths with ability to specify
location grouping and date range of returned data.
get_recoveries
Query reported recoveries with ability to specify
location grouping and date range of returned data.
get_vaccinations
Query reported vaccinations with ability to specify
location grouping and date range of returned data.
You can install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("UBC-MDS/canadacovidmetricsR")
get_cases
Query reported cases with ability to specify
location grouping and date range of returned data.library(canadacovidmetricsR)
get_cases(loc = "BC", date = "2021-03-31")
#> No encoding supplied: defaulting to UTF-8.
#> cases cumulative_cases date province
#> 1 1013 100048 2020-03-31 BC
get_deaths
Query reported deaths with ability to specify
location grouping and date range of returned data.get_deaths(loc = "BC", date = "2021-03-31")
#> No encoding supplied: defaulting to UTF-8.
#> cumulative_deaths date deaths province
#> 1 1458 2020-03-31 3 BC
get_recoveries
Query reported recoveries with ability to specify
location grouping and date range of returned data.get_recoveries(loc = "BC", date = "2021-03-31")
#> No encoding supplied: defaulting to UTF-8.
#> cumulative_recoveries date recoveries province
#> 1 1458 2020-03-31 3 BC
get_veccinations
Query reported vaccinations with ability to specify
location grouping and date range of returned data.get_vaccinations(loc = "BC", date = "2021-03-31")
#> No encoding supplied: defaulting to UTF-8.
#> cumulative_cvaccine cvaccine date province
#> 1 87351 32 2020-03-31 BC
There are several packages for easy access to COVID-19 key metrics or data using different APIs, examples include
To our knowledge, there is no similar package using OpenCovid API in the R ecosystem.
We welcome and recognize all contributions. Please find the guide for contribution in Contributing Document.
canadacovidmetrics
was created by the Contributors. The dependant API
from the COVID-19 Canada Open Data Working Group dataset project has
adopted the Creative Commons Attribution 4.0
International license,
which allows freedom of two primary contributions:
Sharing — copy and redistribute the material in any medium or format Adapting — remix, transform, and build upon the material for any purpose, even commercially.
As contributors to this community, our package has adopted the same creative commons license, in order to enable anyone to share or adapt the Canada Covid Metrics package in R or Python subject to the license.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.