R/get_base_url.R

Defines functions get_base_url

get_base_url <- function( catalog = "CBS"
                        , base_url = getOption("cbsodataR.base_url", BASE_URL)
){
  ## utility wise a better solution, but performance wise not...
  # ds <- cbs_get_datasets(catalog = NULL)
  # catalog <- ds$Catalog[which(id == ds$Identifier)]
  # if (length(catalog) != 1){
  #   stop('"', id, '"'
  #       , "not found in collection of datasets"
  #       , call. = FALSE
  #       )
  # }
  if (isTRUE(catalog != "CBS")){
    base_url <- "https://dataderden.cbs.nl"
  }
  base_url
}

Try the cbsodataR package in your browser

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

cbsodataR documentation built on Jan. 13, 2021, 7:30 p.m.