Usage

To use canadacovidmetricsR package in a project:

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.

Brief introduction:

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.

Functions:

Obtain the total number of cases till date using get_cases():
  • 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
    Obtain the total number of deaths till date using get_deaths():
  • 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
    Obtain the total number of recoveries till date using get_recoveries():
  • 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

    Obtain the total vaccinations using the get_vaccinations():

  • 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

Key Advantages:

  • This package can be used to obtain granular data pertaining to a particular state or province as weel as national wide data.
  • Can be used by people without any need for coding expertise
  • There is scope for customization and the data obtained is easily readable.