View source: R/lib_data_loader.R
| download_data | R Documentation |
Thin wrapper around utils::download.file() that returns the target
path invisibly so it composes in pipelines.
download_data(url, target_path, mode = "wb", quiet = FALSE)
url |
URL to download. |
target_path |
Destination path on disk. |
mode |
Write mode passed to |
quiet |
Logical; suppress progress output. Defaults to |
The target_path, returned invisibly.
# try(): a live download must fail gracefully on an offline check machine.
dest <- try(download_data("https://cloud.r-project.org/",
tempfile(fileext = ".html"), quiet = TRUE))
if (!inherits(dest, "try-error")) file.exists(dest)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.