Skip to contents

A Darwin Core archive is a zip file with a specified combination of data and metadata. This function assumes that all of these file types have been pre-constructed, and can be found inside a single folder, with no additional or redundant information. This function is similar to devtools::build(), in the sense that it takes a repository and wraps it for publication, It differs from devtools::build() in that it builds a Darwin Core Archive, rather than an R package.

Usage

build_archive(source = "data", destination)

Arguments

source

(string) A directory containing all the files to be stored in the archive. Defaults to the data folder within the current working directory.

destination

(string) A file name to save the resulting zip file.

Value

Invisibly returns the location of the built zip file; but typically called for the side-effect of building a 'Darwin Core Archive' (i.e. a zip file).

Details

This function looks for three types of objects in the specified directory:

  • One or more csv files such as occurrences.csv &/or events.csv. These will be manipulated versions of the raw dataset, which have been altered to use Darwin Core terms as column headers. See corella::corella-package() for details.

  • A metadata statement, stored in EML using the filename eml.xml. The function use_metadata() is a good starting point here, followed by build_metadata() once you have populated your metadata statement.

  • A 'schema' document, also stored in xml, called meta.xml. This is usually constructed using build_schema().

You will get an error if these files are not present. The resulting file shares the name of the working directory (with a .zip file extension), and is placed in the parent directory