Learn R Programming

icd (version 2.2)

icd_in_reference_code: match ICD9 codes

Description

Finds children of icd9Reference and looks for icd9 in the resulting vector.

Usage

icd_in_reference_code(icd, icd_reference, short_code, short_reference = TRUE)

icd9 %i9in% icd9Reference

Arguments

short_code

single logical value which determines whether the ICD-9 code provided is in short (TRUE) or decimal (FALSE) form. Where reasonable, this is guessed from the input data.

"icd9, icd9Reference"

is a character vector or factor of ICD-9 codes. If fewer than five characters is given in a code, then the digits are greedily assigned to hundreds, then tens, then units, before the decimal parts. E.g. "10" becomes "010", not "0010".

isShortReference

logical, see argument short_code

Value

logical vector

Examples

Run this code
# NOT RUN {
#%i9in% assumes both test code(s) and reference set of codes are \emph{short}
"1024" %i9in% "102"
"1024" %i9in% c("102", "1025")
c("102", "1024", "1025") %i9in% "102"
c("102", "1024", "1025") %i9in% c("1024", "1025")
c("102", "1024", "1025") %i9in% c("102", "1024", "1025")
# }

Run the code above in your browser using DataLab