On occasion, I have a spotty internet connection or a severely reduced internet connection and I would like to automate web scraping activities. Often times I download files with R, ranging from very small size to several GB. Obviously, if you have a reduced internet connection speed, larger files will take a very long time to download. It would be useful to have this information in R, as a check for proceeding with webscraping.
I'd like to create a script or function in R that is capable of outputting an average internet speed. Is this possible?
I've seen threads that allow you to determine if you have an active internet connection in R. They seem to employ ideas of testing for an internet connection using the RCurl::getURL
or they use system
calls for ipconfig
. One person also found a solution using DNS lookup.