Download and cache a file
Arguments
- url
character(1). Uniform Resource Locator (URL).- pkg
character(1). Package name.- update
logical(1). Callbfcneedsupdateinternally to see if URL needs an update. Doesn't work reliably for all servers, so disabled by default.- ask
logical(1). Ask if package cache needs to be created or if file needs to be updated.- verbose
logical(1). Run the function with verbose output.
Details
Caching requires BiocFileCache and tools packages to be installed. If BiocFileCache is not installed, URL will be downloaded as a temporary file instead.
Examples
url <- AcidBase::pasteUrl(pipetteTestsUrl, "biocfilecache-test.txt")
file <- cacheUrl(url)
#> Error in vapply(X = X, FUN = FUN, FUN.VALUE = logical(1L), ..., USE.NAMES = useNames): formal argument "USE.NAMES" matched by multiple actual arguments
print(file)
#> function (description = "", open = "", blocking = TRUE, encoding = getOption("encoding"),
#> raw = FALSE, method = getOption("url.method", "default"))
#> {
#> .Internal(file(description, open, blocking, encoding, method,
#> raw))
#> }
#> <bytecode: 0x7a669c708>
#> <environment: namespace:base>