code_to_term()
maps SDTM terminology C-codes to respective terms. For
mapping codes representing codelists, use clst_code_to_term()
instead.
Value
A character vector of SDTM controlled terminology terms. The number
of elements returned matches the number of elements in code
, i.e. there
is a one-to-one correspondence between input and output. Invalid codes in
code
are mapped to NA
.
See also
See term_to_code()
for the inverse operation.
Examples
code_to_term(code = "C174106", clst_code = "C141657")
#> [1] "TENMW101"
# Both `code` and `clst_code` are vectorized. `clst_code` will be recycled
# to match `code` number of elements.
code_to_term(code = c("C174106", "C141700"), clst_code = "C141657")
#> [1] "TENMW101" "TENMW102"
# You may mix codelists as long as `code` and `clst_code` have the same
# number of elements; they will be matched element-wise.
code_to_term(
code = c("C174106", "C141700", "C141701"),
clst_code = c("C141657", "C141657", "C141656")
)
#> [1] "TENMW101" "TENMW102" "TENMW1-Test Grade"
# Invalid codes (e.g. `"C00000"`) map to `NA`.
code_to_term(code = c("C174106", "C141700", "C00000"), clst_code = "C141657")
#> [1] "TENMW101" "TENMW102" NA