Description Usage Arguments Details Value Author(s)
View source: R/url-retrieval.R
This helper function tests whether URLs are reachable and throws an error if this is not the case.
1 | dwd2r.url.check(url, number.of.tries = 5)
|
url |
Either a simple string or a character vector of several URLs. |
number.of.tries |
Numerical value of how often the function attempts to test each URL before reporting it to be unavailable. Default = 5. |
The check will be performed number.of.tries
per
URL. The FTP server of the DWD is quite prone to identify the
url.exists
function as an DDOS attempt.
Therefore, the function will wait some random time before
attempting to check the URL. The waiting time will be normal
distributed with a mean of 150ms and a standard deviation of
50ms and the distribution is cut-off at 1ms to be the lowest
possible value (of course we do not want to have negative
waiting times and the Gaussian distribution has infinite
support).
invisible( TRUE )
if all URLs exist. Throws an
error if not.
Philipp Mueller
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.