Add Plot Highlight
iidda_plot_highlight.RdAdd a rectangular highlighted region to an existing ggplot2 plot object
Usage
iidda_plot_highlight(
plot_object,
data = NULL,
series_variable = "deaths",
time_variable = "period_end_date",
filter_variable = "period_end_date",
filter_start = "1700-01-01",
filter_end = "1800-01-01",
...
)Arguments
- plot_object
a
ggplot2plot object- data
data frame containing time series data. If
NULLdata is inherited fromplot_object. This has only been tested with data output fromiidda_plot_ma.- series_variable
column name of series variable in
data, default is "deaths"- time_variable
column name of time variable in
data, default is "period_end_date"- filter_variable
column name of variable to filter on in
data, default is "period_end_date"- filter_start
value of
filter_variablefor starting range, default is "1700-01-01"- filter_end
value of
filter_variablefor ending range, default is "1800-01-01"- ...
other arguments to be passed to
ggforce::geom_mark_rect, for example annotating with text