reorder_pids: Reorder a named list of objects according to the order in the...

View source: R/eml.R

reorder_pidsR Documentation

Reorder a named list of objects according to the order in the metadata

Description

This function takes a named list of data objects, such as what is returned from get_package, and reorders them according to the order they are given in the EML document.

Usage

reorder_pids(pid_list, doc)

Arguments

pid_list

(list) A named list of data pids

doc

(list) an emld document

Value

ordered_pids (list) A list of reordered pids

Examples

## Not run: 
cn <- dataone::CNode('PROD')
adc <- dataone::getMNode(cn,'urn:node:ARCTIC')
ids <- get_package(adc, 'resource_map_doi:10.18739/A2S17SS1M', file_names = TRUE)
doc <- EML::read_eml(dataone::getObject(adc, ids$metadata))

# return all entity types
ordered_pids <- reorder_pids(ids$data, doc)

## End(Not run)


NCEAS/arcticdatautils documentation built on July 13, 2024, 11:02 a.m.