Title: | Covid 19 England Hospital Admissions |
---|---|
Description: | Facilitates access to data on English Covid-19 hospital admissions aggregated to a range of spatial scales. |
Authors: | Sophie Meakin [aut, cre], Sam Abbott [aut] , Sebastian Funk [aut] |
Maintainer: | Sophie Meakin <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-27 05:41:46 UTC |
Source: | https://github.com/epiforecasts/covid19.nhs.data |
Downloads English hospital admissions data by Trust. Data is released each Thursday. See here for details: https://www.england.nhs.uk/statistics/statistical-work-areas/covid-19-hospital-activity/
download_trust_data(release_date = Sys.Date())
download_trust_data(release_date = Sys.Date())
release_date |
Date, release date of data to download. Will automatically find the Thursday prior to the date specified. |
A data.frame of hospital admissions by trust.
LTLA Shapefile for England
england_ltla_shape
england_ltla_shape
An object of class sf
(inherits from tbl_df
, tbl
, data.frame
) with 317 rows and 11 columns.
UTLA Shapefile for England
england_utla_shape
england_utla_shape
An object of class sf
(inherits from tbl_df
, tbl
, data.frame
) with 151 rows and 11 columns.
Downloads hospital admissions by Hospital trust using
download_trust_data
and then optionally aggregates to either LTLA or UTLA
level. This can be done either with the built in mapping or a user supplied mapping.
get_admissions(level = "trust", release_date = Sys.Date(), mapping, geo_names)
get_admissions(level = "trust", release_date = Sys.Date(), mapping, geo_names)
level |
Character string, defaulting to "trust". Defines the level of aggregation at which to return the data. Other supported options are "utla" for UTLA level admissions or "ltla" for LTLA level admissions. |
release_date |
Date, release date of data to download. Will automatically find the Thursday prior to the date specified. |
mapping |
data.frame containing trust_code, p_trust, geo_code and p_geo.
Defaults to |
geo_names |
A dataframe containing |
A data.frame of admissions by day either at trust, LTLA or UTLA levels.
Link Mapping to Trust and Geography Names
get_names(mapping, geo_names)
get_names(mapping, geo_names)
mapping |
data.frame containing trust_code, p_trust, geo_code and p_geo.
Defaults to |
geo_names |
A dataframe containing |
A data.frame containing a UTLA to trust level admissions map combined meaningful names.
Linking File Between LTLA Codes and Names
ltla_names
ltla_names
An object of class tbl_df
(inherits from tbl
, data.frame
) with 340 rows and 2 columns.
Map NHS Hospital aggregated admissions. By default this maps the latest data provided.
map_admissions(admissions, shapefile, date, scale_fill)
map_admissions(admissions, shapefile, date, scale_fill)
admissions |
A data.frame of admissions data as produced by |
shapefile |
A shapefile defaults to |
date |
A date variable (or vector) indicating when to plot data for. |
scale_fill |
A |
A map of Covid-19 admissions in England
Summarise the Trust mapping (currently only supports the UTLA mapping) both graphically and in a table.
summarise_mapping( trust = NULL, geography = NULL, mapping, shapefile, geo_names )
summarise_mapping( trust = NULL, geography = NULL, mapping, shapefile, geo_names )
trust |
A character string indicating a trust of interest. |
geography |
A character string indicating the geography of interest. Only used if
|
mapping |
data.frame containing trust_code, p_trust, geo_code and p_geo.
Defaults to |
shapefile |
A shapefile defaults to |
geo_names |
A dataframe containing |
A table and optional map summarising the admissions mapping.
Mapping Between NHS Trust and LTLA
trust_ltla_mapping
trust_ltla_mapping
An object of class grouped_df
(inherits from tbl_df
, tbl
, data.frame
) with 590 rows and 4 columns.
Linking File Between NHS Trust Codes and Names
trust_names
trust_names
An object of class tbl_df
(inherits from tbl
, data.frame
) with 228 rows and 2 columns.
Mapping Between NHS Trust and UTLA
trust_utla_mapping
trust_utla_mapping
An object of class grouped_df
(inherits from tbl_df
, tbl
, data.frame
) with 426 rows and 4 columns.
Linking File Between UTLA Codes and Names
utla_names
utla_names
An object of class tbl_df
(inherits from tbl
, data.frame
) with 174 rows and 2 columns.