R/config_aa_environments.r

Defines functions set_config

Documented in set_config

#' Norwegian characters in unicode
#' @examples
#' print(csdata::nb)
#' @export nb
nb <- list()
nb$AA <- "\u00C5"
nb$aa <- "\u00E5"
nb$OE <- "\u00D8"
nb$oe <- "\u00F8"
nb$AE <- "\u00C6"
nb$ae <- "\u00E6"

#' Swedish characters in unicode
#' @examples
#' print(csdata::se)
#' @export se
se <- list()
se$OE <- "\u00D6"
se$oe <- "\u00F6"
se$AE <- "\u00C4"
se$ae <- "\u00E4"

#' An environment containing configuration variables
#'
#' Available configuration variables:
#' - border_nor (default 2024): The year in which Norwegian geographical boundaries were designated. Valid values: 2020, 2024.
#' @examples
#' print(ls(csdata::config))
#' for(i in names(csdata::config)){
#'   cat(i, ":", csdata::config[[i]], "\n")
#' }
#' @export
config <- new.env()
config$border_nor <- 2024

#' Set options in the package config
#' @param border_nor The year in which Norwegian geographical boundaries were designated. Valid values: 2020, 2024.
#' @returns Nothing. Side effect of setting the `config` environment.
#' @export
set_config <- function(border_nor = NULL){
  if(!is.null(border_nor)){
    stopifnot(border_nor %in% c(2020, 2024))
    config$border_nor <- border_nor
  }
}

Try the csdata package in your browser

Any scripts or data that you put into this service are public.

csdata documentation built on May 29, 2024, 5:05 a.m.