if (FALSE) {
# Omit the `code` argument to get all possible mappings. Note that
# one-to-many mappings will generate more than one row per `from` code.
map_ontology_code(from = 'oncotree_code', to = 'nci_code')
# Simple example
map_ontology_code('MMB', from = 'oncotree_code', to = 'nci_code')
# Some mappings are one-to-many, e.g. "SRCCR", which means repeated rows for
# the same input code.
map_ontology_code('SRCCR', from = 'oncotree_code', to = 'nci_code')
# Using the `collapse` argument to "collapse" one-to-many mappings makes sure
# that the output has as many rows as the `from` vector.
map_ontology_code('SRCCR',
from = 'oncotree_code',
to = 'nci_code',
collapse = toString)
map_ontology_code('SRCCR',
from = 'oncotree_code',
to = 'nci_code',
collapse = list)
map_ontology_code(
'SRCCR',
from = 'oncotree_code',
to = 'nci_code',
collapse = \(x) paste(x, collapse = ' ')
)
# `map_ontology_code()` is vectorized over `code`
map_ontology_code(
c('AASTR', 'MDEP'),
from = 'oncotree_code',
to = 'nci_code'
)
# Map from ICDO topography to ICDO morphology codes
map_ontology_code(
'C72.9',
from = 'icdo_topography_code',
to = 'icdo_morphology_code'
)
}
Run the code above in your browser using DataLab