get_uk_regional_cases: Get UK daily cases

Description Usage Arguments Value Examples

View source: R/get_uk_regional_cases.R

Description

Get UK cases by country or region

Usage

1
get_uk_regional_cases(geography = "all countries")

Arguments

geography

Character string identifying which part of the UK to extract and at what scale Defaults to "all countries". Options are: "all countries", "all regions", "England", "Scotland", "Northern Ireland", "Wales". Note that England always returns 9 English regions, and Nothern Ireland always returns as one country

Value

A dataframe of case counts. By default returns cases in English regions, and Scotland, Wales, and Northern Ireland

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
uk_countries <- get_uk_regional_cases(geography = "all countries")
uk_regions <- get_uk_regional_cases(geography = "all regions")
england <- get_uk_regional_cases(geography = "England")
wales <- get_uk_regional_cases(geography = "Wales")
scotland <- get_uk_regional_cases(geography = "Scotland")
nireland <- get_uk_regional_cases(geography = "Northern Ireland")

## Not run: 
## Mapping UK countries with English regions
uk_countries <- get_uk_regional_cases(geography = "all countries") %>%
  dplyr::filter(date == max(date))
uk_map <- sf::st_read("data-raw/uk_NUTS_areas/NUTS_Level_1_January_2018_Ultra_Generalised_Clipped_Boundaries_in_the_United_Kingdom.shp") %>%
  dplyr::mutate(nuts118nm = stringr::str_remove_all(nuts118nm, "\\s\\(England\\)")) %>%
  dplyr::left_join(uk_countries, by = c("nuts118nm" = "region"))
uk_map %>%
  ggplot2::ggplot(ggplot2::aes(fill = cases)) +
  ggplot2::geom_sf()


## End(Not run)

epiforecasts/NCoVUtils documentation built on June 26, 2020, 1:20 a.m.