plot_comorbid: Basic ordered bar plot showing counts of each comorbidity

Description Usage Arguments Functions Examples

View source: R/plot.R

Description

Basic ordered bar plot showing counts of each comorbidity

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plot_comorbid(x, comorbid_fun = icd::comorbid_ahrq, ...)

plot_comorbid_results(
  x,
  sort = TRUE,
  fix_margin = FALSE,
  las = 2,
  cex.names = 0.75,
  ...
)

Arguments

x

input patient data

comorbid_fun

Character name of function or function itself, default being comorbid_ahrq

...

Passed to barplot

sort

Logical, default TRUE which sorts the frequencies from high to low.

fix_margin

Logical, default TRUE, which causes a par margin to be set so the x axis labels are less likely to be truncated.

las

Integer, default is 2 which rotates the x axis labels appropriately

cex.names

Numeric, default is 0.75 which scales the text size for labels appropriately

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
library(icd)
plot_comorbid(vermont_dx)
plot_comorbid(uranium_pathology)
# Or calculate the comorbidities, then plot the results
cmb <- comorbid_ahrq(vermont_dx)
# plot with full, not abbreviated names
plot_comorbid_results(cmb, names.arg = names_ahrq)
# or return with full names, and plot those:
comorbid_ahrq(vermont_dx, abbrev_names = FALSE) %>%
  plot_comorbid_results()

## End(Not run)

icd documentation built on July 2, 2020, 4:07 a.m.