R/no_connection.R

Defines functions no_connection

Documented in no_connection

#' Check if computer has internet connection
#'
#' @export

no_connection <- function(){

  #check internet connection
  status <- tryCatch(
    httr::GET("https://www.datim.org/api/sqlViews/fgUtV6e9YIX/data.csv", httr::timeout(60)),
    error = function(e) e)

  inherits(status,  "error")
}
USAID-OHA-SI/tameDP documentation built on Nov. 20, 2019, 2:56 p.m.