download: Download a file from the Internet

View source: R/download.R

downloadR Documentation

Download a file from the Internet

Description

Download a file from the Internet

Usage

download(url, destfile, quiet = FALSE, ...)

Arguments

url

character(1). URL.

destfile

character(1). Destination file.

quiet

logical(1). Suppress status messages.

...

Passthrough arguments to utils::download.file().

Details

Unlike utils::download.file(), intentionally errors on any download failure. Automatically sets a long time out internally via options(timeout = 9999L), to avoid download issues related to timeout configuration in Rprofile.

Value

character(1). Destination file path. Note that this differs from download.file, which returns a status code (e.g. 0 for success) instead.

Note

Updated 2023-01-30.

Examples

url <- "https://bioconductor.org/bioc-version"
destfile <- "bioc-version.txt"
out <- download(url = url, destfile = destfile, quiet = TRUE)
print(out)
file.remove(out)

acidgenomics/r-acidbase documentation built on Jan. 12, 2024, 3:56 a.m.