Learn R Programming

sdtm.terminology (version 2025-3-25)

clst_term_to_code: SDTM code list term to respective code

Description

clst_term_to_code() maps SDTM terminology codelists' terms to respective C-codes. For mapping terms other than those representing codelists, use term_to_code() instead.

Usage

clst_term_to_code(term)

Value

A character vector of SDTM codes for codelists. The number of elements returned matches the number of elements in term, i.e. there is a one-to-one correspondence between input and output. Invalid codes in term are mapped to NA.

Arguments

term

A SDTM controlled terminology term referring to a codelist.

See Also

See clst_code_to_term() for the inverse operation.

Examples

Run this code
clst_term_to_code(term = "SEX")

# `term` is vectorized.
clst_term_to_code(term = c("SEX", "SIZE"))

# Invalid codes (e.g. `"YODA"`) map to `NA`.
clst_term_to_code(term = c("SEX", "SIZE", "YODA"))

Run the code above in your browser using DataLab