canadacovidmetricsR.Rmd
library(canadacovidmetricsR)
This package is designed to provide key metrics regarding COVID-19 situation in Canada at province level using the data from OpenCovid API.
The canadacovidmetricsR
package helps obtain national or provincial level information on covid cases for a specific time period. There are 4 functions which will return key metrics, including total cumulative cases, total cumulative deaths, total cumulative recovered cases and total cumulative vaccine completion. This data is returned as an R Dataframe which can be used directly for further analysis, plotting or applying statistical models.
get_cases
Query total cumulative cases with ability to specify province and date range of returned data.
Example usage:
library(canadacovidmetricsR)
get_cases(loc = "BC", date = "2021-03-31")
#> cases cumulative_cases date province
#> 1 1013 100048 2020-03-31 BC
get_deaths
Query total cumulative deaths with ability to specify province and date range of returned data.
Example usage:
get_deaths(loc = "BC", date = "2021-03-31")
#> cumulative_deaths date deaths province
#> 1 1458 2020-03-31 3 BC
get_recoveries
Query total cumulative recovered cases with ability to specify province and date range of returned data.
Example usage:
get_recoveries(loc = "BC", date = "2021-03-31")
#> cumulative_recovered date province recovered
#> 1 91066 2020-03-31 BC 665
get_vaccinations
Query total cumulative vaccine completion with ability to specify province and date range of returned data.
Example usage:
get_vaccinations(loc = "BC", date = "2021-03-31")
#> cumulative_cvaccine cvaccine date province
#> 1 87351 32 2020-03-31 BC