This function sets the local directory used to store SAFE dataset files along with record and index metadata. The function can also initialise a new data directory, downloading the required index files. By default, it will update indices if needed and will validate the directory contents. Once set, the location of the directory is stored in options('safedata.dir').
A path to the directory to set as the SAFE data directory (str).
Should the local dataset index be updated (logical)?
Should a new data directory be created at the provided path (logical)?
Should the directory structure be validated (logical)?
The safedata package uses a data directory to store local copies of
dataset files along with index files. Files for a dataset record are
stored in subdirectories using the zenodo concept id for the record
and then record id:
3342494/3342495, for example. In addition
to data files from these records, these folders can also contain a
JSON file containing record metadata (e.g.
is a structured version of the summary information shown on the
The root of the data directory also holds three index files:
, containing a full list of the files and dataset records available in the SAFE data repository;
, containing the official list of known sampling locations and GIS data; and
, a list of alternative names permitted for some locations.
create=TRUE, the function will try to create the named
directory and populate it with the three index files. This requires
an internet connection.
By default, the function also needs an internet connection to check for updates to the three index files. Updating can be turned off for offline use.
The default behaviour is also to validate the directory structure. The function will warn when files other than those found in datasets are present within the data structure and when any dataset files that are present have been modified. Although this can be turned off, it is not recommended to modify or add files within a SAFE data directory.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.