Description Usage Arguments Examples
convert matrix of comorbidities into data frame, preserving visitId information
1 2 | icd9ComorbidDfToMat(x, visitId = NULL,
stringsAsFactors = getOption("stringsAsFactors"))
|
x |
data frame, with a |
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. If left empty, or |
stringsAsFactors |
whether the resulting data frame should have strings, i.e. visitId converted to factor. Default is to follow the current session option. |
1 2 3 4 5 6 7 8 | longdf <- data.frame(visitId = c("a", "b", "b", "c"),
icd9 = c("441", "4424", "443", "441"))
cmbdf <- icd9ComorbidElix(longdf, return.df = TRUE)
class(cmbdf)
rownames(cmbdf)
mat.out <- icd9ComorbidDfToMat(cmbdf)
stopifnot(is.matrix(mat.out))
mat.out[, 1:4]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.