| Title: | Utilities for processing forecasts matrices |
|---|---|
| Description: | This package contains utility functions for processing forecasts matrices. |
| Authors: | Sangeeta Bhatia [aut, cre] |
| Maintainer: | Sangeeta Bhatia <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.4.7 |
| Built: | 2026-05-27 07:10:21 UTC |
| Source: | https://github.com/mrc-ide/rincewind |
COVID-19 IFR adjusted for age compoisition of a country
age_wtd_ifr(locations)age_wtd_ifr(locations)
locations |
list of country names. Note that no checks have been implemented to test that the country names are valid. |
a named list with samples from age-weighted IFR for each location
Sangeeta Bhatia
Use Epinow definitions
assign_epidemic_phase2(rt)assign_epidemic_phase2(rt)
rt |
a vector of samples from the posterior distribution |
phase
Sangeeta Bhatia
Cap predictions to twice the observed for visualisation
cap_predictions(pred)cap_predictions(pred)
data.frame with capped predictions
Sangeeta Bhatia
A dataset containing a list of countries and corresponding continents. We use this because it lists countries in North America and South America separately.
country_continent_mappingcountry_continent_mapping
A data frame with 210 rows and 2 variables:
name of country or territory
continent
Customise plots to be aligned in rows in the manuscript
customise_for_rows(plots, in_rows)customise_for_rows(plots, in_rows)
plots |
list of ggplot2 objects |
in_rows |
list of indices of plots that will be put in rows |
The very first plot will have legend but no x-axis text; all plots in the middle will have no legend and no x-axis text, and the very last plot will have no legend but x-axis text
Check if two intervals overlap
overlaps(x1, x2, digits)overlaps(x1, x2, digits)
x1 |
a numeric vector of length 2 |
x2 |
a numeric vector of length 2 |
digits |
integer indicating the number of decimal places to be used |
TRUE if x1 and x2 overlap
Sangeeta Bhatia
Projections plot
plot_projections(obs, pred)plot_projections(obs, pred)
obs |
data frame with columns dates and deaths |
pred |
data frame with columns dates, val, .lower and .upper. This is an output of ggdist::median_qi function. |
ggplot object
Sangeeta Bhatia
Defines a date scale to be used for all figures.
scale_date_manuscript(date_breaks, date_labels, xmin)scale_date_manuscript(date_breaks, date_labels, xmin)
date_breaks |
breaks for x-axis, Defaults to 1 month |
date_labels |
labels, default is day-month |
incidence package accepts a linelist like object (list of dates) and converts them into an incid object, which is needed by projections package. To use projections package with a time-series we convert time-series object into incid object.
ts_to_incid(ts, date_col, case_col)ts_to_incid(ts, date_col, case_col)
Sangeeta Bhatia