Function to (heuristically) test for a network connection by attempting to connect to a given website.
isConnected(site = "https://opentdb.com/")
site | Character variable with site to try to connect to,
defauls to |
---|
A boolean value indicating networking status
This function was kindly provided by Dirk Eddelbuettel as part of this SO answer (https://stackoverflow.com/questions/66773611/cran-example-fails-if-run-offline-talks-to-external-api). It is copied here to avoid the `dang` dependency.
Dirk Eddelbuettel