Learn R Programming

icd9 (version 0.2.1)

icd9ShortToParts: extract major and minor parts of a decimal ICD-9 code

Description

accepts Vxxxx Exxxx or xxxxx

Usage

icd9ShortToParts(icd9Short, minorEmpty = "", invalidAction = c("ignore",
  "silent", "warn", "stop"))

Arguments

icd9Short
is a character vector 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"
minorEmpty
vector of length one, to be used in place of minor part of zero. Defaults to ""
invalidAction
character string (unit length) containing one of: "ignore", "silent", "warn", "stop"

- ignore no check for validity of ICD-9 code is made implicitly. This is the fastest option. If the function call is explicitly to check validity, e

Value

  • data.frame with two columns. At least the minor part must be character, because "03" is different to "3", but "30" is the same as "3" at least in ICD-9 if leadingZeroes is true, then the major part must also be character.