Returns a deep clone of spec with the specified codes appended to the
given key(s). The original spec is never modified.
Usage
add_codes(spec, variable_type = c("condition", "outcome", "both"), ...)Arguments
- spec
A CodeSpec object.
- variable_type
Which membership flag(s) to set for the new codes.
"condition"setscondition = TRUE, outcome = FALSE;"outcome"setscondition = FALSE, outcome = TRUE;"both"(default) sets both toTRUE.- ...
Named arguments where the name is a code-set key (e.g.,
dx_icd9) and the value is a character vector of codes to add.
Examples
my_htn <- add_codes(
spec_hypertension_v1,
dx_icd10 = c("I119", "I130")
)