Skip to content

print or summary method for classcodes object #39

@eribul

Description

@eribul

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions