Skip to contents

Plot a raw case count proportion timeseries

Usage

plot_proportions_data(
  raw = i_proportion_data,
  ...,
  mapping = .check_for_aes(raw, ...),
  events = i_events
)

Arguments

raw

The raw count and denominator data - a dataframe with columns:

  • denom (positive_integer) - Total test counts associated with the specified time frame

  • count (positive_integer) - Positive case counts associated with the specified time frame

  • time (ggoutbreak::time_period + group_unique) - A (usually complete) set of singular observations per unit time as a `time_period`

Any grouping allowed.

...

Named arguments passed on to geom_events

events

Significant events or time spans - a dataframe with columns:

  • label (character) - the event label

  • start (date) - the start date, or the date of the event

  • end (date) - the end date or NA if a single event

Any grouping allowed.

A default value is defined.

mapping

a ggplot2::aes mapping. Most importantly setting the colour to something if there are multiple incidence timeseries in the plot

events

Significant events or time spans - a dataframe with columns:

  • label (character) - the event label

  • start (date) - the start date, or the date of the event

  • end (date) - the end date or NA if a single event

Any grouping allowed.

A default value is defined.

Value

a ggplot object

Examples

# example code

tmp = dplyr::tibble(
  time = as.time_period(1:10, "1 day"),
  count = 101:110
) %>% dplyr::mutate(
  denom = count*time
)

if(interactive()) {
  plot_proportions_data(tmp)+ggplot2::geom_line()
}