tests/testthat/helper.R

#test internet availability used by multiple tests
internetAvailable <- function()
{
  curl::has_internet()
}

siteIsAvailable <- function(site)
{
  temp <- curl::curl_download(site, "temp.html")
  
  if(exists("temp"))
  {
    file.remove(temp)
    
    return(TRUE)
  }
  
  return(FALSE)
}

Try the Rnightlights package in your browser

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

Rnightlights documentation built on Aug. 29, 2019, 5:02 p.m.