Learn R Programming

icd9 (version 1.1)

icd9ComorbidDfToMat: convert matrix of comorbidities into data frame, preserving visitId information

Description

convert matrix of comorbidities into data frame, preserving visitId information

Usage

icd9ComorbidDfToMat(x, visitId = NULL,
  stringsAsFactors = getOption("stringsAsFactors"))

Arguments

x

data frame, with a visitId column (not necessarily first), and other columns with flags for comorbidities, as such column names are required.

visitId

The name of the column in the data frame which contains the patient or visit identifier. Typically this is the visit identifier, since patients come leave and enter hospital with different ICD-9 codes. It is a character vector of length one. Defaults to "visitId"

stringsAsFactors

whether the resulting data frame should have strings, i.e. visitId converted to factor. Default is to follow the current session option.