
Last chance! 50% off unlimited learning
Sale ends in
Last chance! 50% off unlimited learning
Sale ends in
Function to (heuristically) test for a network connection by attempting to connect to a given website.
isConnected(site = "https://www.google.com")
A boolean value indicating networking status
Character variable with site to try to connect to,
defauls to http://www.google.com
Dirk Eddelbuettel
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.