Package 'rincewind'

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: 2024-11-20 04:35:27 UTC
Source: https://github.com/mrc-ide/rincewind

Help Index


Age-weighted IFR of COVID-19

Description

COVID-19 IFR adjusted for age compoisition of a country

Usage

age_wtd_ifr(locations)

Arguments

locations

list of country names. Note that no checks have been implemented to test that the country names are valid.

Value

a named list with samples from age-weighted IFR for each location

Author(s)

Sangeeta Bhatia


Assign epidemic phase

Description

Use Epinow definitions

Usage

assign_epidemic_phase2(rt)

Arguments

rt

a vector of samples from the posterior distribution

Value

phase

Author(s)

Sangeeta Bhatia


Cap predictions to twice the observed for visualisation

Description

Cap predictions to twice the observed for visualisation

Usage

cap_predictions(pred)

Value

data.frame with capped predictions

Author(s)

Sangeeta Bhatia


Country to continent mapping

Description

A dataset containing a list of countries and corresponding continents. We use this because it lists countries in North America and South America separately.

Usage

country_continent_mapping

Format

A data frame with 210 rows and 2 variables:

Countries and territories

name of country or territory

continent

continent


Customise plots to be aligned in rows in the manuscript

Description

Customise plots to be aligned in rows in the manuscript

Usage

customise_for_rows(plots, in_rows)

Arguments

plots

list of ggplot2 objects

in_rows

list of indices of plots that will be put in rows

Details

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

Description

Check if two intervals overlap

Usage

overlaps(x1, x2, digits)

Arguments

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

Value

TRUE if x1 and x2 overlap

Author(s)

Sangeeta Bhatia


projections plot with median and various quantiles

Description

Projections plot

Usage

plot_projections(obs, pred)

Arguments

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.

Value

ggplot object

Author(s)

Sangeeta Bhatia


Defines a date scale to be used for all figures.

Description

Defines a date scale to be used for all figures.

Usage

scale_date_manuscript(date_breaks, date_labels, xmin)

Arguments

date_breaks

breaks for x-axis, Defaults to 1 month

date_labels

labels, default is day-month


Convert time-series to incidence object

Description

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.

Usage

ts_to_incid(ts, date_col, case_col)

Author(s)

Sangeeta Bhatia