Downloads data table from URL. If an error occurs during the query (for example due to no connection) the function waits 3 seconds and tries again. If no result could be obtained after the given number of tries a message indicating the problem is returned.

try_query(
  url,
  max_tries = 5,
  silent = TRUE,
  type = "text/tab-separated-values",
  ...
)

Arguments

url

a character value of an URL to the website that contains the table that should be downloaded.

max_tries

a numeric value that specifies the number of times the function tries to download the data in case an error occurs.

silent

a logical value that specifies if individual messages are printed after each try that failed.

type

a character value that specifies the type of data at the target URL. Options are all options that can be supplied to httr::content, these include e.g. "text/tab-separated-values", "application/json" and "txt/csv". Default is "text/tab-separated-values". Default is "tab-separated-values".

...

other parameters supplied to the parsing function used by httr::content.

Value

A data frame that contains the table from the url.