Reputation: 13817
I would like to find a way to temporarily suspend my internet connection from within R, and turn it on back again latter. This is necessary to run some package tests to check if some package functions follow CRAN policies:
"Packages which use Internet resources should fail gracefully with an informative message if the resource is not available (and not give a check warning nor error)."
This is what I would like to do:
library(curl)
# turn internet connection offline
# check
if (!curl::has_internet()) {
message("No internet connection.")
}
# get connection back online
Upvotes: 1
Views: 88