Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

isConnected

Is the current session (networked) and connected?


Description

Function to (heuristically) test for a network connection by attempting to connect to a given website.

Usage

isConnected(site = "https://www.google.com")

Arguments

site

Character variable with site to try to connect to, defauls to http://www.google.com

Details

The main page of Google is used as a proxy for overall network connectivity as Google is generally 'network-close' and the page is relatively small. If a network is unavailable this fails generally already on domain name service resolution. Special thanks to Barry and Brodie for a very helpful discussion re-discovering this function.

Value

A boolean value indicating networking status

Author(s)

Dirk Eddelbuettel


dang

'Dang' Associated New Goodies

v0.0.13
GPL (>= 2)
Authors
Dirk Eddelbuettel with contributions by Brodie Gaslam, Kevin Denny, Kabira Namit, Colin Gillespie, R Core, Josh Ulrich, and others.
Initial release
2021-02-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.