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]
Run the code above in your browser using DataLab