
Download all files from a 4TU.ResearchData article
Source:R/archive-4tu.R
researchdata4tu_file_download.RdThin wrapper around figshare_file_download() with host = "data.4tu.nl"
– see the note at the top of this file. Creates a directory for the
article and downloads all of its files. Returns (invisibly) a data frame
with file info.
Usage
researchdata4tu_file_download(
researchdata4tu_id,
download_to,
max_file_size = 10,
max_download_size = 100,
unzip_types = NULL,
pb = NULL
)Arguments
- researchdata4tu_id
a 4TU.ResearchData article ID, uuid, URL, or DOI
- download_to
path to download to; there is no default, because CRAN does not allow writing into the working directory unless you ask for it
- max_file_size
maximum file size to download (in MB) - set to NULL or Inf for no restrictions
- max_download_size
maximum total size to download - set to NULL or Inf for no restrictions
- unzip_types
file categories to extract from
.zipfiles in the article rather than downloading the zip whole, named asdata_classify_files()names them:"data","code","materials","documentation","output","unknown". More than one may be given.NULL(the default) downloads zips whole and leaves them zipped, as before.max_file_sizeapplies to each extracted member rather than to the archive.- pb
a progress bar passed from another function
Value
data frame of file info. When members are extracted from a zip, its
row reports the zip with extracted giving the number of members written;
size_on_disk and checksum_ok are then NA, because what is on disk is
the members rather than the archive 4TU.ResearchData published a size and
MD5 for.
Details
Uses researchdata4tu_pat(), not figshare_pat(), for authentication
(see that function's documentation for why the two are separate).