Plot AWaRe data

awr_plot(
  df,
  atc = atc,
  ddd = ddd,
  time = NULL,
  unit = NULL,
  ncol = NULL,
  legend.position = NULL,
  runs.analysis = TRUE,
  ...
)

Arguments

df

Data frame.

atc

ATC code.

ddd

Amount.

time

Time period.

unit

Organisational unit.

ncol

Integer, number of columns in faceted plots.

legend.position

Character, where to put legend (e.g. 'none', 'right', 'bottom').

runs.analysis

Logical, if TRUE (default) add runs analysis to plot. See Details.

...

Other arguments to awr_aggregate and ggplot.

Value

A ggplot object.

Details

The plot show the relative distribution of antibiotics in the three AWaRe classes as suggested by WHO (https://adoptaware.org/): green = access, amber = watch, red = reserve.

If runs.analysis = TRUE (default) and time is provided, the plot will include a horisontal line representing the median of the access proportion. If the runs analysis finds non-random variation in the form of either unusually long runs of data points on the same side of the centre line or unusually few crossing of the centre line (Anhøj 2014, doi: 10.1371/journal.pone.0113825 ), the line will be dashed, otherwise the line is solid.

Examples

awr_plot(abx_sales, atc, ddd)
#> Aggregating data using the "dk" AWaRe classification
awr_plot(abx_sales, atc, ddd, unit = region)
#> Aggregating data using the "dk" AWaRe classification
awr_plot(abx_sales, atc, ddd, time = month)
#> Aggregating data using the "dk" AWaRe classification
awr_plot(abx_sales, atc, ddd, time = month, unit = region)
#> Aggregating data using the "dk" AWaRe classification
awr_plot(abx_sales, atc, ddd, time = month, unit = hospital, ncol = 4)
#> Aggregating data using the "dk" AWaRe classification