Skip to content

Instantly share code, notes, and snippets.

@ernestguevarra
Created July 22, 2020 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ernestguevarra/507e2f005b847399c3cfcc7dc794476d to your computer and use it in GitHub Desktop.
Save ernestguevarra/507e2f005b847399c3cfcc7dc794476d to your computer and use it in GitHub Desktop.
download <- function(url, quiet = TRUE) {
"!DEBUG Downloading `url`"
path <- tempfile()
status <- utils::download.file(
url,
path,
method = download_method(),
quiet = quiet,
mode = "wb"
)
if (status != 0) stop("Cannot download file from ", url, call. = FALSE)
path
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment