Learn R Programming

icd9 (version 0.2.1)

icd9SortShort: sort short-form icd9 codes

Description

should work with numeric only, V or E codes. Note that a numeric sort does not work for ICD-9 codes, since "162" > "1620" TODO: write tests. TODO: reply with the actual items given (not trimmed, etc.) TODO: need to be able to compare a pair of codes quickly, then use built-in sort. This becomes easier when I move to S3 classes for ICD-9.

Usage

icd9SortShort(icd9Short, 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"
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

  • sorted vector of ICD-9 codes