R wrapper for "axel" (multi-threaded) and "download.file" (single-threaded) download functions.

downloader(
  input_url,
  output_path = file.path(tempdir(), basename(input_url)),
  download_method = c("axel", "wget", "download.file", "internal", "wininet",
    "libcurl", "wget", "curl"),
  background = FALSE,
  force_overwrite = FALSE,
  quiet = TRUE,
  show_progress = TRUE,
  continue = TRUE,
  nThread = parallel::detectCores() - 1,
  alternate = TRUE,
  check_certificates = TRUE,
  timeout = 30 * 60,
  conda_env = "echoR"
)

Arguments

input_url

URL to remote file.

output_path

The file name you want to save the download as.

download_method
  • "axel" : Multi-threaded

  • "wget" : Single-threaded

  • "download.file" : Single-threaded

  • "internal" : Single-threaded (passed to download.file)

  • "wininet" : Single-threaded (passed to download.file)

  • "libcurl" : Single-threaded (passed to download.file)

  • "curl" : Single-threaded (passed to download.file)

or "download.file" (single-threaded) .

background

Run in background

force_overwrite

Overwrite existing file.

quiet

Run quietly.

show_progress

show_progress.

continue

continue.

nThread

Number of threads to parallelize over.

alternate

alternate,

check_certificates

check_certificates

timeout

How many seconds before giving up on download. Passed to download.file. Default: 30*60 (30min).

conda_env

Conda environment to use.

Value

Local path to downloaded file.

See also

Other downloaders: axel(), wget()

Examples

rda_url<-"https://github.com/RajLabMSSM/echolocatoR/raw/master/data/BST1.rda" out_path <- downloadR::downloader( input_url = rda_url, download_method = "axel" )
#> Downloading with axel (using 11 cores).
#> + CONDA:: Identified axel executable in echoR env.
#> Time difference of 3.086858 secs