term_to_code(term = "TENMW101", clst_code = "C141657")
# Both `term` and `clst_code` are vectorized. `clst_code` will be recycled
# to match `term` number of elements.
term_to_code(term = c("TENMW101", "TENMW102"), clst_code = "C141657")
# You may mix codelists as long as `term` and `clst_code` have the same
# number of elements; they will be matched element-wise.
term_to_code(
term = c("TENMW101", "TENMW102", "TENMW1-Test Grade"),
clst_code = c("C141657", "C141657", "C141656")
)
# Invalid terms (e.g. `"Gambelas"`) map to `NA`.
term_to_code(term = c("TENMW101", "TENMW102", "Gambelas"), clst_code = "C141657")
Run the code above in your browser using DataLab