Learn R Programming

canadacovid (version 0.3.4)

get_subregion_vaccination_data: Get sub-region vaccination data

Description

Runs a GET request of sub-region vaccination data from the COVID-19 tracker API, and returns parsed data. The dates argument specifies the time frame of the data: "current" (the default; latest report for each sub-region), "recent" (15 most recent reports for each sub-region), and "all" (returns all reports for one or more sub-regions specified by the subregion_code argument). To get a list of available sub-regions, use the function get_subregions().

Usage

get_subregion_vaccination_data(
  dates = c("current", "recent", "all"),
  subregion_code = NULL
)

Value

A data frame with one row per sub-region report.

Arguments

dates

One of "current", "recent", or "all" to specify the time frame of the reports returned. If choosing "all" reports, must also provide one or more sub-region codes.

subregion_code

One or more sub-region codes. Returns all reports for those sub-regions (even if dates is not "all")

Details

Note that sub-region vaccination data is only for select provinces and territories. Also the percentages reported differ between percent of total population, and percent of eligible population. See the API documentation for more details: https://api.covid19tracker.ca/docs/1.0/vaccinations.

Examples

Run this code

get_subregion_vaccination_data()
get_subregion_vaccination_data("recent")
get_subregion_vaccination_data("all", subregion_code = c("ON382", "SK007"))

Run the code above in your browser using DataLab