R/ua_to_vjb.R

Defines functions ua_to_vjb

Documented in ua_to_vjb

#' Find the valuation joint board for a UA code
#'
#' @param ua_code UA code for a council
#'
#' @return VJB for the council
#' @export
#'
#' @examples ua_to_vjb(230)
ua_to_vjb <- function(ua_code) {

  # Sort out inputs -----------------------------------------------------------
  ua_code <- as.numeric(ua_code)

  # Return VJB name for UA code -----------------------------------------------
  dplyr::case_when(ua_code == 100 ~ "Grampian",
                   ua_code == 110 ~ "Grampian",
                   ua_code == 120 ~ "Tayside",
                   ua_code == 130 ~ "Dunbartonshire and Argyll and Bute",
                   ua_code == 230 ~ "Lothian",
                   ua_code == 150 ~ "Central",
                   ua_code == 170 ~ "Dumfries and Galloway",
                   ua_code == 180 ~ "Tayside",
                   ua_code == 190 ~ "Ayrshire",
                   ua_code == 200 ~ "Dunbartonshire and Argyll and Bute",
                   ua_code == 210 ~ "Lothian",
                   ua_code == 220 ~ "Renfrewshire",
                   ua_code == 240 ~ "Central",
                   ua_code == 250 ~ "Fife",
                   ua_code == 260 ~ "Glasgow",
                   ua_code == 270 ~ "Highland and Western Isles",
                   ua_code == 280 ~ "Renfrewshire",
                   ua_code == 290 ~ "Lothian",
                   ua_code == 300 ~ "Grampian",
                   ua_code == 235 ~ "Highland and Western Isles",
                   ua_code == 310 ~ "Ayrshire",
                   ua_code == 320 ~ "Lanarkshire",
                   ua_code == 330 ~ "Orkney and Shetland",
                   ua_code == 340 ~ "Tayside",
                   ua_code == 350 ~ "Renfrewshire",
                   ua_code == 355 ~ "Scottish Borders",
                   ua_code == 360 ~ "Orkney and Shetland",
                   ua_code == 370 ~ "Ayrshire",
                   ua_code == 380 ~ "Lanarkshire",
                   ua_code == 390 ~ "Central",
                   ua_code == 395 ~ "Dunbartonshire and Argyll and Bute",
                   ua_code == 400 ~ "Lothian",
                   ua_code == 999 ~ "Scotland")

}
n-fanton/ndr documentation built on Dec. 21, 2021, 11:07 p.m.