Skip to contents

Get Covid-19 Data

Functions that provide interfaces to download cleaned and processed datasets. Internally many of these functions call the classes documented below and so optional class specific arguments can also be used.

get_available_datasets()
Get supported data sets
get_national_data()
Get national-level data for countries globally from a range of sources
get_regional_data()
Get regional-level data
initialise_dataclass()
Initialise a child class of DataClass if it exists
DataClass
R6 Class containing non-dataset specific methods
CountryDataClass
R6 Class containing national level methods

Dataset Classes

Classes that define individual datasets and contain all the methods needed to download, process, and clean them.

Belgium
Belgium Class for downloading, cleaning and processing notification data
Brazil
Brazil Class for downloading, cleaning and processing notification data
Canada
Canada Class containing origin specific attributes and methods
Colombia
Colombia Class for downloading, cleaning and processing notification data
Covid19DataHub
R6 Class containing specific attributes and methods for Covid19 Data Hub
Cuba
Cuba Class for downloading, cleaning and processing notification data
ECDC
R6 Class containing specific attributes and methods for the European Centre for Disease Prevention and Control dataset
Estonia
Estonia Class for downloading, cleaning and processing notification data
France
France Class containing origin specific attributes and methods
Germany
Germany Class for downloading, cleaning and processing notification data
Google
R6 Class containing specific attributes and methods for Google data
India
India Class for downloading, cleaning and processing notification data
Italy
Italy Class for downloading, cleaning and processing notification data
JHU
R6 Class containing specific attributes and methods for John Hopkins University data
JRC
R6 Class containing specific attributes and methods for European Commission's Joint Research Centre data
Lithuania
Lithuania Class for downloading, cleaning and processing notification data
Mexico
Meixco Class for downloading, cleaning and processing notification data
Netherlands
Netherlands Class for downloading, cleaning and processing notification data
SouthAfrica
SouthAfrica Class for downloading, cleaning and processing notification data
Switzerland
Switzerland Class for downloading, cleaning and processing notification data
UK
United Kingdom Class for downloading, cleaning and processing notification data.
USA
USA Class for downloading, cleaning and processing notification data
WHO
R6 Class containing specific attributes and methods for World Health Organisation data

Dataset processing

Functions used to process data once it has been cleaned into a standardised format. These functions are split into compulsory processing options, which are always used, and optional processing functions which may be added/removed by the user.

Compulsory processing

add_extra_na_cols()
Add extra columns filled with NA values to a dataset.
calculate_columns_from_existing_data()
Cumulative counts from daily counts or daily counts from cumulative, dependent on which columns already exist
complete_cumulative_columns()
Completes cumulative columns if rows were added with NAs.
fill_empty_dates_with_na()
Add rows of NAs for dates where a region does not have any data

Optional processing

set_negative_values_to_zero()
Set negative data to 0
totalise_data()
Get totals data given the time series data.

Utilities

Utility functions that either help manage data, provide additional information, or convert the data into new formats.

all_country_data
Table of available datasets along with level and other information. Rendered from the individual R6 class objects included in this package.
check_level()
Checks a given level is supported
csv_reader()
Custom CSV reading function
download_excel()
Download Excel Documents
glue_level()
Glue the spatial level into a variable name
json_reader()
Custom JSON reading function
make_github_workflow()
Create github action for a given source
make_new_data_source()
Create new country class for a given source
message_verbose()
Wrapper for message
process_internal()
Internal Shared Regional Dataset Processing
region_dispatch()
Control Grouping Variables used in process_internal
reset_cache()
Reset Cache and Update all Local Data
return_data()
Control data return
run_default_processing_fns()
Default processing steps to run
run_optional_processing_fns()
Optional processing steps to run
start_using_memoise()
Add useMemoise to options
stop_using_memoise()
Stop using useMemoise

Tests

Testing functions that check at each step (cleaning, processing, returning) the data structure and types are as expected. Requires testthat to be installed.

expect_clean_cols()
Test clean columns contain the correct data and types
expect_columns_contain_data()
Test that cleaned columns contain data/
expect_processed_cols()
Test that processed columns contain the correct data and types
test_cleaning()
Test clean method works correctly
test_download()
Test download method works correctly
test_download_JSON()
Test download method for JSON files works correctly
test_processing()
Test process method works correctly
test_return()
Test return method works correctly

Datasets

Package datasets

JHU_codes
Region Codes for JHU Dataset. Taken from the region codes provided as part of the WHO dataset.
colombia_codes
Region Codes for Colombia Dataset.
france_codes
Region Codes for France Dataset.
lithuania_codes
Region Codes for Lithuania Dataset.
mexico_codes
Region Codes for Mexico Dataset.
uk_codes
Region Codes for UK Dataset.
vietnam_codes
Region Codes for Vietnam Dataset.