select a set of elements from a term 'map' and return a contribution to a data.frame
Source:R/mapNaive.R
selectFromMap.Rd
select a set of elements from a term 'map' and return a contribution to a data.frame
Arguments
- namedvec
named character vector, as returned from
mapOneNaive
- index
numeric() or integer(), typically of length one
Value
a data.frame; if index
does not inherit from
numeric
, a data.frame of one row with columns 'ontoid'
and 'term' populated with NA_character_
is returned,
otherwise a similarly named data.frame is returned with
contents from the selected elements of namedvec
Examples
#co = ontoProc::getCellOnto()
co = getOnto("cellOnto", year_added="2023")
#> loading from cache
mast = mapOneNaive("astrocyte", co)
selectFromMap(mast, 1)
#> ontoid term
#> 1 CL:0000127 astrocyte