Skip to contents

Plot the posterior prediction for the growth rate

Usage

plot_growth(posterior, forecast_dates = NULL, central = FALSE, col = NULL)

Arguments

posterior

A dataframe of posterior output as produced by fv_tidy_posterior(). For forecast dates to be extracted data with value_type == "cases" must be present.

forecast_dates

A data.frame in the format produced by extract_forecast_dates() (with at least a date variable and a Data unavailable variable)). Specifies when date availability should be add to plots. May contain faceting variables.

central

Logical, defaults to FALSE. Should the mean and median central estimates be plot as dashed and solid lines respectively. Requires mean and median variables to be present in the input.

col

A character string denoting the variable to use to stratify the ribbon plot. Defaults to "type" which indicates the data stream.

Value

A ggplot2 plot.

Examples

posterior <- fv_example(strains = 2, type = "posterior")
plot_growth(posterior)