Skip to contents

This function copies a remote file to a local cache once and makes sure it is reused.

Usage

cache_download(
  url,
  ...,
  .nocache = getOption("cache.disable", default = FALSE),
  .cache = getOption("cache.download.dir", default =
    rappdirs::user_cache_dir("ggrrr-download")),
  .stale = getOption("cache.stale", default = Inf),
  .extn = NULL
)

Arguments

url

the url to download

...

passed to `utils::download.file()`

.nocache

if set to TRUE all caching is disabled

.cache

the location of the downloaded files

.stale

how long to leave this file before replacing it.

.extn

the file name extension

Value

the path to the downloaded file