melt_icd9list {medicalrisk} | R Documentation |
Convert ICD-9-CM code list to dataframe
Description
melt_icd9list
uses ddply
to melt a column of comma-separated ICD-9-CM
codes into a series of rows, one for each code.
Usage
melt_icd9list(
df,
idvar = "id",
icd9var = "icd9cm",
.progress = "none",
.parallel = FALSE,
.paropts = NULL
)
Arguments
df |
a data frame with at least two columns, specified as |
idvar |
string with name of ID variable within |
icd9var |
string with name of ICD code variable within |
.progress |
passed to |
.parallel |
passed to |
.paropts |
passed to |
Value
a dataframe with two columns, idvar
and "icd9cm"
Examples
cases <- data.frame(id=c(1,2),
icd9list=c('162.4,070.30,155.0,401.9','996.52,E878.8,V45.86'),
stringsAsFactors=TRUE)
melt_icd9list(cases, "id", "icd9list")
[Package medicalrisk version 1.3 Index]