Learn R Programming

icd9 (version 1.3.1)

icd9FilterValid: Filter ICD-9 codes by validity.

Description

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

Usage

icd9FilterValid(icd9df, icd9Field = NULL, isShort = NULL, 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 codes. This is a character vector of length one. If it is NULL, icd9 will attempt to guess the column name, looking for progressively less likely possibilities until it matche a single column. Failing this, it will take the first column in the data frame. Specifying the column using this argument avoids the guesswork.
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 invalid instead of valid rows.