Skip to contents

code_to_term() maps SDTM terminology C-codes to respective terms. For mapping codes representing codelists, use cl_code_to_term() instead.

Usage

code_to_term(code, code_list)

Arguments

code

A C-code with a leading character C followed by a sequence of digits used for uniquely identifying each concept in NCI Thesaurus (NCIt), including all CDISC concepts.

code_list

Parent codelist code.

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", code_list = "C141657")
#> [1] "TENMW101"

# Both `code` and `code_list` are vectorized. `code_list` will be recycled
# to match `code` number of elements.
code_to_term(code = c("C174106", "C141700"), code_list = "C141657")
#> [1] "TENMW101" "TENMW102"

# You may mix codelists as long as `code` and `code_list` have the same
# number of elements; they will be matched element-wise.
code_to_term(
  code = c("C174106", "C141700", "C141701"),
  code_list = 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"), code_list = "C141657")
#> [1] "TENMW101" "TENMW102" NA