Decode Antibiotic Short Codes to Full Names
Source:R/prep_standardize_antibiotics.R
prep_decode_antibiotic_code.RdConverts antibiotic short codes (e.g. AMK, AMP, AMPSUL) to full antibiotic names using a caller-supplied code map CSV.
Usage
prep_decode_antibiotic_code(
data,
code_col = "antibiotic_name_raw",
map_path = NULL,
output_col = "antibiotic_name_std"
)Arguments
- data
Data frame with a column of antibiotic codes.
- code_col
Character. Column containing antibiotic codes. Default "antibiotic_name_raw".
- map_path
Character. Path to the code map CSV file. Must have columns
codeandantibiotic_name_full. If NULL, falls back toinst/extdata/antibiotic_code_map.csvif it exists.- output_col
Character. Name of the output column for decoded names. Default "antibiotic_name_std".