Skip to content

Commit

Permalink
Update summarise_mapping() checks
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiemeakin committed Aug 23, 2022
1 parent 54121b1 commit 199c78d
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions R/summarise_mapping.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,23 @@
#' @export
summarise_mapping <- function(trust = NULL, geography = NULL, mapping, shapefile, geo_names) {

# Trust/geography checks
if (is.null(trust) & is.null(geography)) {
stop("Either a trust or a geography must be specified")
}

if (missing(shapefile)){
shapefile <- covid19.nhs.data::england_utla_shape
}
# Mapping checks
if (missing(mapping)) {
mapping <- covid19.nhs.data::trust_utla_mapping
}
if (missing(geo_names)) {
geo_names <- covid19.nhs.data::utla_names
stop("Missing mapping - please specify a LTLA- or UTLA-Trust mapping.")
} else {
# Shapefile checks
if (missing(shapefile)) {
stop("Missing shapefile - please specify an appropriate shapefile.")
}
# Geography names checks
if (missing(geo_names)) {
stop("Missing geo_names - please specify appropriate geography names.")
}
}

if(!is.null(trust)){
Expand Down

0 comments on commit 199c78d

Please sign in to comment.