Downloads a specific version of the Portal Predictions repository from either GitHub or Zenodo (based on source) into the <main>/raw sub.
Usage
download_archive(
main = ".",
resources_sub = "resources",
version = "latest",
source = "github",
quiet = FALSE,
verbose = FALSE,
force = FALSE,
pause = 30,
timeout = getOption("timeout")
)Arguments
- main
charactervalue defining the main component of the portalcasting directory tree.- resources_sub
charactervalue defining the resources subdirectory of the portalcasting directory tree.- version
characterversion of the data to download. Default"latest"downloads the most recent (by date published).NULLmeans no download.- source
characterindicator of the source for the download. Either"github"(default) or"zenodo".- quiet
logicalindicator if progress messages should be quieted.- verbose
logicalindicator if detailed messages should be generated.- force
logicalindicator of whether or not existing files or folders (such as the archive) should be over-written if an up-to-date copy exists (most users should leave asFALSE).- pause
Positive
integeror integernumericseconds for pausing during steps around unzipping that require time delay.- timeout
Positive
integeror integernumericseconds for timeout on downloads. Temporarily overrides the"timeout"option inoptions.
Value
NULL, invisible-ly.
Note
There are two calls to base::Sys.sleep for pause seconds each to allow for the file unzipping, copying, and such to catch up.
See also
Other downloads:
download climate forecasts
Examples
if (FALSE) { # \dontrun{
main1 <- file.path(tempdir(), "archive")
create_dir(main = main1)
download_archive(main = main1)
unlink(main1, recursive = TRUE)
} # }