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

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'.

Value

(doc) The modified EML document.

Author

Dominic Mullen dmullen17@gmail.com

Examples

if (FALSE) { 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') }