use_metadata: Use a metadata statement in a Darwin Core Archive

View source: R/use_metadata.R

use_metadataR Documentation

Use a metadata statement in a Darwin Core Archive

Description

A metadata statement lists the owner of the dataset, how it was collected, and how it can be used (i.e. its' licence). This function reads and converts metadata saved in markdown (.md), Rmarkdown (.Rmd) or Quarto (.qmd) to xml, and saves it in the data-publish directory.

This function is a convenience wrapper function of delma::read_md() and delma::write_eml().

Usage

use_metadata(file = NULL, overwrite = FALSE, quiet = FALSE)

Arguments

file

A metadata file in Rmarkdown (.Rmd) or Quarto markdown (.qmd) format.

overwrite

By default, use_metadata() will not overwrite existing files. If you really want to do so, set this to TRUE.

quiet

Whether to message about what is happening. Default is set to FALSE.

Details

To be compliant with the Darwin Core Standard, the schema file must be called eml.xml, and this function enforces that.

Value

Does not return an object to the workspace; called for the side effect of building a file in the data-publish directory.

See Also

use_metadata_template() to create a metadata statement template; use_data() to save data to ⁠/data-publish⁠.

Examples



# Get a boilerplate metadata statement
use_metadata_template(file = "my_metadata.Rmd", quiet = TRUE)

# Once editing is complete, call `use_metadata()` to convert to an EML file
use_metadata("my_metadata.Rmd", quiet = TRUE)

# Check that file has been created
list.files("data-publish")

# returns "eml.xml" as expected



galaxias documentation built on Aug. 8, 2025, 7:50 p.m.