melt_icd9list: Convert ICD-9-CM code list to dataframe

Description Usage Arguments Value Examples

View source: R/icd9cm.R

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

1
2
3
4
5
6
7
8
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 and icd9var.

idvar

string with name of ID variable within df (defaults to "id")

icd9var

string with name of ICD code variable within df (defaults to "icd9cm")

.progress

passed to ddply

.parallel

passed to ddply

.paropts

passed to ddply

Value

a dataframe with two columns, idvar and "icd9cm"

Examples

1
2
3
4
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")

medicalrisk documentation built on March 26, 2020, 6:31 p.m.