R/utils.R

Defines functions has_internet

Documented in has_internet

#' Check for Internet
#'
#' Used to skip tests and examples for this package when offline.
#'
#' @return TRUE if the internet is available, false otherwise
#' @export
#'
#' @examples
#' has_internet()
#'
has_internet <- function() {
  !is.null(curl::nslookup("r-project.org", error = FALSE))
}

Try the rosm package in your browser

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

rosm documentation built on Aug. 27, 2023, 9:06 a.m.