Commit e4dcc048 authored by Marek Ostaszewski's avatar Marek Ostaszewski
Browse files

improved access functions - added get_components_annotations

parent 93bdf6b0
Pipeline #39941 passed with stages
in 42 seconds
......@@ -78,3 +78,13 @@ get_annotation <- function(references, selected_type) {
if(length(references) == 0) { return(NA) }
with(data.frame(references), resource[type == selected_type])
}
### A function retrieving element identifiers from a given MINERVA element set
get_component_annotations <- function(components, annotation_type) {
### Get MINERVA references as a named list
message(paste0("Retrieving ", annotation_type, "identifiers for this MINERVA collection"))
### Apply get_annotation function
mnv_refs <- sapply(fcomponents$map_elements, function(x) sapply(x$references, get_annotation, annotation_type) )
names(mnv_refs) <- fcomponents$models$name
return(mnv_refs)
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment