R/generate_url.R

Defines functions generate_url

Documented in generate_url

#' @title Generates the downloads URL of the election zip file
#'
#' @param tipo The code of the type of election you want to download.
#' @param anno The year of the election in YYYY format.
#' @param mes The month of the election in MM format.
#'
#' @return A string
#'
#' @keywords internal
#'
generate_url <- function(tipo, anno, mes, level) {
  BASEURL <- "https://infoelectoral.interior.gob.es/estaticos/docxl/apliextr/"
  url <- paste0(BASEURL, tipo, anno, mes, "_", level, ".zip")

  return(url)
}

Try the infoelectoral package in your browser

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

infoelectoral documentation built on June 22, 2024, 6:59 p.m.