Skip to contents

Add a bar plot to an exiting ggplot plot object. Graphical choices were made to closely reflect plots generated with `LBoM::monthly_bar_graph` and `LBoM::weekly_bar_graph`.

Usage

iidda_plot_bar(
  plot_object,
  data = NULL,
  series_variable = "deaths",
  time_unit = "week"
)

Arguments

plot_object

a `ggplot2` plot object

data

data frame containing data prepped for bar plotting, typically output from `iidda_prep_bar()`. If `NULL` data is inherited from `plot_object`

series_variable

column name of series variable in `data`, default is "deaths"

time_unit

time unit to display bar graphs on the x-axis. Defaults to "week" or one of iidda.analysis:::time_units that starts with "month". Should generalize at some point to be able to take any time_unit argument.

Value

a ggplot2 plot object containing a bar graphs of time series data