R/set_nomis_api.R

Defines functions set_nomis_api

Documented in set_nomis_api

#' Set API Key
#'
#' Helper function to set the NOMIS API key as an environment variable
#'
#' @param key the NOMIS API Key (unique ID)
#'
#' @examples
#' \dontrun{
#' set_nomis_api('<api key here>')
#' # Check our assignment worked
#' Sys.getenv('nomis_api_key')
#'
#' #[1] "<api key here>"
#' }
#'
#' @export

set_nomis_api <- function(key){
  Sys.setenv(nomis_api_key = key)
}
Chrisjb/RDistanceMatrix documentation built on Jan. 27, 2021, 9:12 p.m.