Is the current session (networked) and connected?
Function to (heuristically) test for a network connection by attempting to connect to a given website.
isConnected(site = "https://www.google.com")
site |
Character variable with site to try to connect to,
defauls to |
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.
A boolean value indicating networking status
Dirk Eddelbuettel
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.