R/get_specialty_lookup.R

Defines functions get_specialty_lookup

Documented in get_specialty_lookup

#' Read in the Specialty Grouping lookup file from National Reference Files
#'
#' @param var_grouping When FALSE, removes the variable 'grouping' (default FALSE)
#'
#' @return A data frame containing specialty codes and the names of the specialties
#' @export
#'
get_specialty_lookup <- function(var_grouping = FALSE) {
  return <- haven::read_sav(fs::path(get_nrf_dir(), "Specialty_Groupings.sav")) %>%
    janitor::clean_names()
  if (var_grouping == FALSE) {
    return <- return %>% select(-grouping)
    return(return)
  } else {return(return)}
}
shintoLamp/bluenile documentation built on Aug. 6, 2022, 6:29 a.m.