Plot the percents of a computed CHAMPS table

heatmap_site_age(
  x,
  plot_title = "",
  plot_subtitle = "",
  include_text = "percent",
  color_limits = NULL
)

Arguments

x

A computed CHAMPS object that includes a numerator and denominator of counts.

plot_title

is the title for the plot.

plot_subtitle

is the subtitle for the plot.

include_text

Whether to include the percentages "percent", or fraction "fraction". Defaults to NULL which is none.

color_limits

maps to the limits argument in the fill scale of ggplot2. Defaults to NULL which is the max and min of the data. Specify the limits in proportions like c(0, 0.25) to have standard limits for multiple charts set to 0% to 25%.

Examples

mock_calc <- calc_cc_allcases_by_site_age(mock,
  condition = 'Streptococcus agalactiae')
heatmap_site_age(mock_calc, include_text = "percent",
  plot_title = "TAC Results", plot_subtitle = "Streptococcus pneumoniae")
heatmap_site_age(mock_calc, include_text = "fraction",
  plot_title = "TAC Results", plot_subtitle = "Streptococcus pneumoniae")