Learn R Programming

icd9 (version 0.2.1)

appendZeroToNine: append zero to nine

Description

appends the characters "0" to "9" to elements of character vector Used for extrapolating all the possible ICD9 codes in order to match. The alternative approach is the way done in the 'comorbidities' package, but this has a load of messy seq() functions in the middle of the comorbid groups specification, and as far as I can tell, some errors arising from the non-numeric nature of ICD-9 codes. My way allows simple specification of, e.g. code "100" and all possible child codes are captured. #examples #appendZeroToNine("1") #appendZeroToNine(1:3)

Usage

appendZeroToNine(str)

Arguments

str
vector of numbers (or character representation of numbers)

Value

  • vector of characters with 0 to 9 appended to each input value