Description Usage Arguments Value See Also Examples
View source: R/get_national_data.R
Provides an interface to source specific classes which
support national level data. For simple use cases this allows downloading
clean, standardised, national-level COVID-19 data sets. Internally this uses
the CountryDataClass()
parent class which allows documented downloading,
cleaning, and processing. Optionally all steps of data processing can be
returned along with the functions used for processing but by default just
the finalised processed data is returned. See the examples for some
potential use cases and the links to lower level functions for more details
and options.
1 2 3 4 5 6 7 8 9 10 |
countries |
A character vector specifying country names of interest. Used to filter the data. |
source |
A character string specifying the data source (not case
dependent). Defaults to WHO (the World Health Organisation). See
|
level |
A character string indicating the target administrative level
of the data with the default being "1". Currently supported options are
level 1 ("1) and level 2 ("2"). Use |
totals |
Logical, defaults to FALSE. If TRUE, returns totalled data per region up to today's date. If FALSE, returns the full dataset stratified by date and region. |
steps |
Logical, defaults to FALSE. Should all processing and cleaning steps be kept and output in a list. |
class |
Logical, defaults to FALSE. If TRUE returns the
|
verbose |
Logical, defaults to |
... |
Additional arguments to pass to class specific functionality. |
A tibble with data related to cases, deaths, hospitalisations, recoveries and testing.
WHO()
, ECDC()
, JHU()
, Google()
Data interface functions
CountryDataClass
,
DataClass
,
get_available_datasets()
,
get_regional_data()
,
initialise_dataclass()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
# set up a data cache
start_using_memoise()
# download all national data from the WHO
get_national_data(source = "who")
# download data for Canada keeping all processing steps
get_national_data(countries = "canada", source = "ecdc")
# download data for Canada from the JHU and return the full class
jhu <- get_national_data(countries = "canada", source = "jhu", class = TRUE)
jhu
# return the JHU data for canada
jhu$return()
# check which regions the JHU supports national data for
jhu$available_regions()
# filter instead for France (and then reprocess)
jhu$filter("France")
jhu$process()
# explore the structure of the stored JHU data
jhu$data
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.