download_safe_files: Download SAFE dataset files

Description Usage Arguments Details Value Warning Examples

View source: R/load_safe.R

Description

This downloads files associated with SAFE datasets, either all of the files included in a set of records (xlsx_only=FALSE) or just the core .xlsx files (xlsx_only=FALSE), and stores them in the SAFE data directory. Currently, there is no mechanism for importing restricted datasets.

Usage

1
2
download_safe_files(record_ids, confirm = TRUE, xlsx_only = TRUE,
  download_metadata = TRUE, refresh = FALSE, token = NULL)

Arguments

record_ids

A vector of SAFE dataset record ids or a safe_record_set object.

confirm

Requires the user to confirm before download (logical)

xlsx_only

Should all files be downloaded or just the core .xslx file (logical)

download_metadata

Should the metadata record for the file be downloaded (logical)

refresh

Should the function check if local copies have been modified and download fresh copies. This is useful if the local copies have unintentionally been modified but note the warning above.

token

An access token for restricted datasets. Not currently implemented.

Details

By default, the function will also download the dataset metadata. This information is required by many of the functions in the package but users can turn off automatic metadata download.

Value

Invisibly, a vector of paths for successfully downloaded files.

Warning

Using refresh=TRUE will overwrite locally modified files and replace them with the versions of record from Zenodo.

Examples

1
2
3
4
   
   recs <- validate_record_ids(c(3247631, 3266827, 3266821))
   download_safe_files(recs)
   

ImperialCollegeLondon/safe_data documentation built on Oct. 8, 2019, 4:27 p.m.