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.

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

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