Public methods
Method set_region_codes()
Specific function for getting region codes for UK .
Usage
UK$set_region_codes()
Method download()
UK specific download()
function.
Usage
UK$download()
Method clean_level_1()
Region Level Data Cleaning
Usage
UK$clean_level_1()
Method clean_level_2()
Level 2 Data Cleaning
Usage
UK$clean_level_2()
Method new()
Initalize the UK Class
Usage
UK$new(nhsregions = FALSE, release_date = NULL, resolution = "utla", ...)
Arguments
nhsregions
Return subnational English regions using NHS region
boundaries instead of PHE boundaries.
release_date
Date data was released. Default is to extract
latest release. Dates should be in the format "yyyy-mm-dd".
resolution
"utla" (default) or "ltla", depending on which
geographical resolution is preferred
...
Optional arguments passed to DataClass()
initalize.
Examples
\dontrun{
UK$new(
level = 1, localise = TRUE,
verbose = True, steps = FALSE,
nhsregions = FALSE, release_date = NULL,
resolution = "utla"
)
}
Method download_filter()
Helper function for downloading data API
Usage
UK$download_filter(filter)
Arguments
filter
region filters
Method set_filters()
Set filters for UK data api query.
Usage
UK$set_filters()
Method download_nhs_regions()
Download NHS data for level 1 regions
Separate NHS data is available for "first" admissions, excluding
readmissions. This is available for England + English regions only.
Data are available separately for the periods 2020-08-01 to 2021-04-06,
and 2021-04-07 - present.
See: https://www.england.nhs.uk/statistics/statistical-work-areas/covid-19-hospital-activity/
Section 2, "2. Estimated new hospital cases"
Usage
UK$download_nhs_regions()
Returns
nhs data.frame of nhs regions
Method add_nhs_regions()
Add NHS data for level 1 regions
Separate NHS data is available for "first" admissions, excluding
readmissions. This is available for England + English regions only.
See: https://www.england.nhs.uk/statistics/statistical-work-areas/covid-19-hospital-activity/
Section 2, "2. Estimated new hospital cases"
Usage
UK$add_nhs_regions(clean_data, nhs_data)
Arguments
clean_data
Cleaned UK covid-19 data
nhs_data
NHS region data
Method specific_tests()
Specific tests for UK data. In addition to generic tests ran
by DataClass$test()
data for NHS regions are downloaded and ran through
the same generic checks (test_cleaning, test_processing, test_return). If
download = TRUE or a snapshot file is not found, the nhs data is
downloaded and saved to the snapshot location provided. If an existing
snapshot file is found then this data is used in the next tests.
Tests data can be downloaded, cleaned, processed and returned. Designed
to be ran from test
and not ran directly.
Usage
UK$specific_tests(
self_copy,
download = FALSE,
all = FALSE,
snapshot_path = "",
...
)
Arguments
self_copy
R6class the object to test.
download
logical. To download the data (TRUE) or use a snapshot
(FALSE). Defaults to FALSE.
all
logical. Run tests with all settings (TRUE) or with those
defined in the current class instance (FALSE). Defaults to FALSE.
snapshot_path
character_array the path to save the downloaded
snapshot to. Works on the snapshot path constructed by test
but adds
...
Additional parameters to pass to specific_tests
Method clone()
The objects of this class are cloneable with this method.
Usage
UK$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.