Learn R Programming

covidregionaldata (version 0.8.2)

get_national_data: Get national-level data for countries globally, sourced from the ECDC or WHO.

Description

Gets raw data using the source-specific function. Includes ISO country codes. Then adds columns which were missing from the raw data (calculating cumulative counts from new dailies and vice versa), cleans and sanitises further. Adds rows and columns of NA values so that data is in a standard format.

Usage

get_national_data(country = NULL, totals = FALSE, source = "ecdc")

Arguments

country

Character A string specifying the country to get data from. Not case or language dependent. Defaults to all countries.

totals

Boolean. If TRUE, returns totalled data per country up to today's date. If FALSE, returns the full dataset stratified by date and country.

source

Character A string specifying the data source: "WHO", or "ECDC". Not case dependent. Defaults to ECDC.

Value

A tibble with data related to cases, deaths, hospitalisations, recoveries and testing.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
 get_national_data(country = "canada", totals = TRUE, source = "WHO")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab