eml_set_shared_attributes: Set shared attribute references

View source: R/deprecated.R

eml_set_shared_attributesR Documentation

Set shared attribute references

Description

\Sexpr[results=rd, stage=render]{lifecycle::badge("deprecated")}

Usage

eml_set_shared_attributes(doc, attributeList = NULL, type = "dataTable")

Arguments

doc

(emld) An EML object.

attributeList

(attributeList) Optional. An EML attributeList object. If not provided then it will default to the attributeList of the first type element.

type

(character) Optional. Specifies whether to replace 'dataTable' or 'otherEntity' attributeList objects with references. Defaults to 'dataTable'.

Details

please add references directly instead

This function sets shared attributes using the attributes of the first type selected and creates references for all remaining objects of equivalent type.

Value

(doc) The modified EML document.

Author(s)

Dominic Mullen dmullen17@gmail.com

Examples

## Not run: 
cn <- dataone::CNode('PROD')
adc <- dataone::getMNode(cn,'urn:node:ARCTIC')
doc <- EML::read_eml(dataone::getObject(adc, 'doi:10.18739/A2S17SS1M'))
atts <- EML::set_attributes(
                     EML::get_attributes(eml$dataset$dataTable[[1]]$attributeList)$attributes)

eml <- eml_set_shared_attributes(eml, atts, type = 'dataTable')

## End(Not run)

NCEAS/arcticdatautils documentation built on Aug. 28, 2023, 12:10 p.m.