print.icd9: Print ICD codes and comorbidity maps cleanly

View source: R/class.R

print.icd9R Documentation

Print ICD codes and comorbidity maps cleanly

Description

Print ICD codes and comorbidity maps cleanly

Usage

## S3 method for class 'icd9'
print(x, verbose = FALSE, ...)

## S3 method for class 'icd10'
print(x, verbose = FALSE, ...)

Arguments

x

ICD codes to be printed

verbose

Annotate based on code attributes, e.g., decimal versus short codes.

...

arguments passed on to other functions

Examples

x <- structure(
  c("40201", "2258", "7208", "25001", "34400", "4011", "4011", NA),
  class = c("icd9cm", "icd9", "character"),
  icd_short_diag = TRUE
)
## Not run: 
print(x)
print(x, verbose = TRUE)
# as.factor drops any 'icd' classes
print(as.factor(x), verbose = TRUE)

## End(Not run)
## Not run: 
u <- uranium_pathology[1:10, "icd10"]
print(u)
print(u, verbose = TRUE)
# as.character will unclass the 'icd' classes
print(as.character(u), verbose = TRUE)
a <- structure(c("R21", "Z21"),
  class = c("icd10cm", "icd10", "character")
)
print(a, verbose = TRUE)

## End(Not run)

jackwasey/icd documentation built on Dec. 22, 2024, 4:47 a.m.