JDownload | R Documentation |
The intent of this function is to save time downloading files by only downloading them if they haven't previously been downloaded. Files will be downloaded if they have been modified since the previous download (as determined by HTTP If-Modified-Since header). On some platforms, caching does not seem to work correctly. On those platforms, the files are always downloaded.
JDownload(
url,
tempfileFn = NULL,
cacheDir = tempdir(),
filePattern = "jdcache",
verbose = FALSE,
debug = FALSE
)
url |
Character vector specifying the URLs to be downloaded. |
tempfileFn |
Function to create names of downloaded files. (defaults to
tempfile). Must accept the same arguments as the base R function
|
cacheDir |
Passed to |
filePattern |
Passed to |
verbose |
If TRUE, prints status messages. |
debug |
If TRUE, prints debugging messages. |
A file is created within cacheDir
which contains the URL, file name
and modification date of each downloaded file in the directory. It is used to
determine whether a URL needs to be downloaded again. The file is in R
serialised object format (readRDS
, saveRDS
). The URL is always
fetched (using httr::GET
), however the http header
If-Modified-Since
is specified so that it will not be downloaded again
if it is unmodified.
Array of names of the downloaded files.
download.file
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.