get_eml_attributes_url: Return attribute (column) metadata from a DataONE package URL

View source: R/get_eml_attributes.R

get_eml_attributes_urlR Documentation

Return attribute (column) metadata from a DataONE package URL

Description

Return attribute metadata from an EML object or DataONE package URL. This is largely a wrapper for the function EML::get_attributes().

Usage

get_eml_attributes_url(
  mn,
  url_path,
  write_to_csv = FALSE,
  prefix_file_names = FALSE,
  download_directory = NULL
)

Arguments

mn

(MNode/CNode) The DataONE Node that stores the Metadata object, from https://cn.dataone.org/cn/v2/node

url_path

(character) The URL of the DataONE Package.

write_to_csv

(logical) Optional. Option whether to download the attribute metadata to csv files. Defaults to FALSE

prefix_file_names

(logical) Optional. Whether to prefix file names with the package metadata identifier. This is useful when downloading files from multiple packages to one directory.

download_directory

(character) Optional. Directory to download attribute metadata csv files to. Required if write_to_csv is TRUE.

Value

(list) A list of all attribute metadata from the EML in data.frame objects.

Author(s)

Dominic Mullen, dmullen17@gmail.com

Examples

## Not run: 
attributes <- get_eml_attributes(mn,
"https://arcticdata.io/catalog/#view/doi:10.18739/A23W02")

# Download attribute metadata in csv format:
attributes <- get_eml_attributes(mn,
"https://arcticdata.io/catalog/#view/doi:10.18739/A23W02",
write_to_csv = TRUE,
download_directory = tempdir())
# switch nodes
cn <- dataone::CNode('PROD')
knb <- dataone::getMNode(cn,"urn:node:KNB")
attributes <- get_eml_attributes(knb,
"https://knb.ecoinformatics.org/#view/doi:10.5063/F1639MWV")

## End(Not run)

NCEAS/datamgmt documentation built on June 5, 2023, 6:14 a.m.