downloadFile( archive, targetFile, neededFiles, destinationPath = getOption("reproducible.destinationPath", "."), quick, checksumFile, dlFun = NULL, checkSums, url, needChecksums, overwrite = getOption("reproducible.overwrite", TRUE), verbose = getOption("reproducible.verbose", 1), purge = FALSE, .tempPath, ... )
Optional character string giving the path of an archive
targetFile, or a vector giving a set of nested archives
c("xxx.tar", "inner.zip", "inner.rar")). If there is/are (an) inner
archive(s), but they are unknown, the function will try all until it finds
targetFile. See table in
preProcess(). If it is
then it will not attempt to see it as an archive, even if it has archive-like
file extension (e.g.,
.zip). This may be useful when an R function
is expecting an archive directly.
Character string giving the filename (without relative or
absolute path) to the eventual file
(raster, shapefile, csv, etc.) after downloading and extracting from a zip
or tar archive. This is the file before it is passed to
postProcess. The internal checksumming does not checksum
the file after it is
postProcessed (e.g., cropped/reprojected/masked).
prepInputs will do a sufficient job in these cases.
See table in
Character string giving the name of the file(s) to be extracted.
Character string of a directory in which to download
and save the file that comes from
url and is also where the function
will look for
targetFile. NOTE (still experimental):
To prevent repeated downloads in different locations, the user can also set
options("reproducible.inputPaths") to one or more local file paths to
search for the file before attempting to download. Default for that option is
NULL meaning do not search locally.
Logical. This is passed internally to
(the quickCheck argument), and to
Cache() (the quick argument). This results in faster, though
less robust checking of inputs. See the respective functions.
A character string indicating the absolute path to the
Optional "download function" name, such as
"raster::getData", which does
custom downloading, in addition to loading into R. Still experimental.
A checksums file, e.g., created by Checksums(..., write = TRUE)
Optional character string indicating the URL to download from.
If not specified, then no download will be attempted. If not entry
exists in the
destinationPath), an entry
will be created or appended to. This
CHECKSUMS.txt entry will be used
in subsequent calls to
preProcess, comparing the file on hand with the ad hoc
CHECKSUMS.txt. See table in
A numeric, with
0 indicating do not write a new checksums,
1 write a new one,
2 append new information to existing one.
Logical. Should downloading and all the other actions occur even if they pass the checksums or the files are all there.
Numeric, -1 silent (where possible), 0 being very quiet,
1 showing more messaging, 2 being more messaging, etc.
Default is 1. Above 3 will output much more information about the internals of
Caching, which may help diagnose Caching challenges. Can set globally with an
options('reproducible.verbose' = 0) to reduce to minimal
Logical or Integer.
0/FALSE (default) keeps existing
CHECKSUMS.txt file and
prepInputs will write or append to it.
1/TRUE will deleted the entire
CHECKSUMS.txt file. Other options, see details.
Optional temporary path for internal file intermediate steps. Will be cleared on.exit from this function.
dlFun. Still experimental. Can be e.g.,
type for google docs.
This function is called for its side effects, which will be a downloaded file
targetFile), placed in
destinationPath. This file will be checksummed, and
that checksum will be appended to the