R/check_internet.R

Defines functions check_internet

Documented in check_internet

#' Check whether the internet is on
#'
#' Check for internet
#' @return TRUE if internet connection is detected, FALSE otherwise.
#' @importFrom httr GET
#' @keywords internal
check_internet <- function() {
  tryCatch(class(httr::GET("http://www.google.com/")) == "response",
    error = function(e) {
      return(FALSE)
    }
  )
}

Try the TNRS package in your browser

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

TNRS documentation built on June 24, 2024, 5:19 p.m.