
Plot the reporting triangle as an age-period-cohort hexamap
plot_reporting_hexamap.RdDraws the reporting triangle as a hexagonal age-period-cohort map, using the
projection of Jalal and Burke (2020). Event date, report date and reporting
delay are the cohort, period and age of the map (report = event + delay), and
each (event, delay) cell is one hexagon coloured by its report count. Because
a batch is a single report date, it appears as a clean vertical stripe;
the fast-reporting bulk sits along the short-delay bottom edge.
Usage
plot_reporting_hexamap(
x,
max_delay = NULL,
complete = FALSE,
iso = NULL,
iso_minor = NULL,
format = "%d/%b/%y",
max_cells = 12000L,
trans = "sqrt",
palette = .tbl_now_palette()
)Arguments
- x
A
tbl_now()object.- max_delay
Largest delay (in report units) to draw.
NULL(default) shows the observed range, auto-capped to respectmax_cells.- complete
If
TRUE, fill the whole observable triangle with zeros so the grey background shows every observable cell. DefaultFALSE(observed cells only). Coerces linelist input to counts viato_count().- iso, iso_minor
Major and minor grid spacings (in report units).
NULLpicks sensible defaults from the data.- format
Date format for the event/report tick labels (see
strftime()). Default"%d/%b/%y".- max_cells
Safety cap on the number of hexagons. Default
12000.- trans
Fill transform for the count scale. Default
"sqrt".- palette
A named colour palette. Defaults to the package palette.
Details
The three axes are read off three families of iso-lines: report date (period) runs vertically, delay (age) up the right-hand spine, and event date (cohort) up the left. A major/minor triangular grid is drawn so any hexagon can be traced back to its event date, report date and delay.
The number of hexagons is #\{observed (event, delay) cells\}, which grows with
the delay range. To stay responsive the delay axis is capped so at most
max_cells hexagons are drawn (raise max_cells, or set max_delay, to change
this). complete = TRUE first fills the whole observable triangle with explicit
zeros (via complete_zeroes()) so the empty cells are shown in grey.
References
Jalal, H. and Burke, D. S. (2020). Hexamaps for Age-Period-Cohort Data Visualization. Epidemiology 31, e47-e49.
