tests/testthat/helper-skip.R

skip_if_server_unavailable <- function() {
  url <- "https://infoelectoral.interior.gob.es"
  tryCatch(
    {
      httr::HEAD(url, httr::timeout(5))
    },
    error = function(e) {
      skip(paste("Server unavailable:", conditionMessage(e)))
    }
  )
}

Try the infoelectoral package in your browser

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

infoelectoral documentation built on April 29, 2026, 9:07 a.m.