Learn R Programming

icd9 (version 1.0)

icd9FilterInvalid: Filter ICD-9 codes by invalidity.

Description

Filters a data.frame of patients for valid or invalid ICD-9 codes

Usage

icd9FilterInvalid(icd9df, icd9Field = "icd9",
  isShort = icd9GuessIsShort(icd9df[[icd9Field]]), invert = FALSE)

Arguments

icd9df

data frame containing columns for visitId (which is the feault name), icd9 (default for the icd9 code), and maybe also a POA flag.

icd9Field

The column in the data frame which contains the ICD-9 codes. This is a character vector of length one.

isShort

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.

invert

single logical value, if TRUE will return valid instead of invalid rows.