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

isConnected(site = "https://opentdb.com/")

Arguments

site

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

Value

A boolean value indicating networking status

Details

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.

Author

Dirk Eddelbuettel