download_file | R Documentation |
Try all possible methods in download.file()
(e.g., libcurl
, curl
,
wget
, and wininet
) and see if any method can succeed. The reason to
enumerate all methods is that sometimes the default method does not work,
e.g., https://stat.ethz.ch/pipermail/r-devel/2016-June/072852.html.
download_file(
url,
output = url_filename(url),
...,
.error = "No download method works (auto/wininet/wget/curl/lynx)"
)
url |
The URL of the file. |
output |
Path to the output file. By default, it is determined by
|
... |
Other arguments to be passed to |
.error |
An error message to signal when the download fails. |
The output
file path if the download succeeded, or an error if none
of the download methods worked.
To allow downloading large files, the timeout
option in options()
will be temporarily set to one hour (3600 seconds) inside this function
when this option has the default value of 60 seconds. If you want a
different timeout
value, you may set it via options(timeout = N)
, where
N
is the number of seconds (not 60).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.