ropensci / coder

Classification of Cases into Deterministic Categories
https://docs.ropensci.org/coder/
22 stars 4 forks source link

print or summary method for classcodes object #39

Closed eribul closed 6 years ago

eribul commented 6 years ago

Present classcodes objects in a readable way that can be used in articles etc.

library(dplyr)

cl <- classifyr::classify(decoder:::icd10$key, classifyr::charlson_icd10)
cl <- cl[rowSums(cl) > 0,]

y <-
  data.frame(
    icd10 = rownames(cl),
    comorbidity = gsub("_", " ", classifyr::charlson_icd10$group[apply(cl, 1, which)]),
    stringsAsFactors = FALSE
  ) %>%
  dplyr::group_by(comorbidity) %>%
  dplyr::summarise(icd10 = paste(icd10, collapse = ", "))

write.csv2(y, "charlson_icd10_codes.cvs")
eribul commented 6 years ago

charlson_icd10.xlsx

eribul commented 6 years ago

Set new attribute "code" to identify which code base is used for each classcodes object (icd10 etc).