downloadData | R Documentation |
Download external data for a module if not already present in the module directory, or if there is a checksum mismatch indicating that the file is not the correct one.
downloadData(
module,
path,
quiet,
quickCheck = FALSE,
overwrite = FALSE,
files = NULL,
checked = NULL,
urls = NULL,
children = NULL,
...
)
## S4 method for signature 'character,character,logical'
downloadData(
module,
path,
quiet,
quickCheck = FALSE,
overwrite = FALSE,
files = NULL,
checked = NULL,
urls = NULL,
children = NULL,
...
)
## S4 method for signature 'character,missing,missing'
downloadData(module, quickCheck, overwrite, files, checked, urls, children)
## S4 method for signature 'character,missing,logical'
downloadData(
module,
quiet,
quickCheck,
overwrite,
files,
checked,
urls,
children
)
## S4 method for signature 'character,character,missing'
downloadData(
module,
path,
quickCheck,
overwrite,
files,
checked,
urls,
children
)
module |
Character string giving the name of the module. |
path |
Character string giving the path to the module directory. |
quiet |
Logical. This is passed to |
quickCheck |
Logical. If |
overwrite |
Logical. Should local data files be overwritten in case they exist?
Default is |
files |
A character vector of length 1 or more if only a subset of files should be checked in the ‘CHECKSUMS.txt’ file. |
checked |
The result of a previous |
urls |
Character vector of urls from which to get the data. This is automatically
found from module metadata when this function invoked with
|
children |
The character vector of child modules (without path) to also
run |
... |
Passed to |
downloadData
requires a checksums file to work, as it will only download
the files specified therein. Hence, module developers should make sure they
have manually downloaded all the necessary data and ran checksums
to
build a checksums file.
There is an experimental attempt to use the googledrive package to download
data from a shared (publicly or with individual users) file.
To try this, put the Google Drive URL in sourceURL
argument of
expectsInputs
in the module metadata, and put the filename once downloaded
in the objectName
argument.
If using RStudio Server, you may need to use "out of band" authentication by
setting options(httr_oob_default = TRUE)
.
To avoid caching of Oauth credentials, set options(httr_oauth_cache = TRUE)
.
There is also an experimental option for the user to make a new ‘CHECKSUMS.txt’
file if there is a sourceURL
but no entry for that file.
This is experimental and should be used with caution.
Invisibly, a list of downloaded files.
Alex Chubaty & Eliot McIntire
prepInputs()
, checksums()
, and downloadModule()
for downloading modules and building a checksums file.
# In metadata, each expectsInput has a sourceURL; downloadData will look for
# that and download if it defined; however this sample module has all
# NAs for sourceURL, so nothing to download
modulePath <- getSampleModules(tempdir())
downloadData("caribouMovement", path = modulePath)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.