dwd2r.url.check: Checking the validity of URLs

Description Usage Arguments Details Value Author(s)

View source: R/url-retrieval.R

Description

This helper function tests whether URLs are reachable and throws an error if this is not the case.

Usage

1
dwd2r.url.check(url, number.of.tries = 5)

Arguments

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.

Details

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).

Value

invisible( TRUE ) if all URLs exist. Throws an error if not.

Author(s)

Philipp Mueller


theGreatWhiteShark/dwd2r documentation built on May 22, 2019, 2:26 p.m.