plot_forecast: Visualize forecast output

View source: R/utils.R

plot_forecastR Documentation

Visualize forecast output

Description

This function serves as a plotting mechanism for prepped forecast submission data (see format_for_submission). Using truth data supplied, the plots show the historical trajectory of each outcome along with the point estimates for forecasts. Optionally, the user can include 50% prediction interval as well. Plots include trajectories of incident cases, incident deaths, and cumulative deaths faceted by location.

Usage

plot_forecast(
  .data,
  submission,
  target = c("Incident Cases", "Incident Deaths", "Cumulative Deaths"),
  location = "US",
  pi = TRUE
)

Arguments

.data

Historical truth data for all locations and outcomes in submission targets

submission

Formatted submission

target

Vector specifying target(s) to plot; default is c('Incident Cases','Incident Deaths','Cumulative Deaths')

location

Vector specifying locations to filter to; 'US' by default.

pi

Logical as to whether or not the plot should include 50% prediction interval; default is TRUE

Value

A ggplot2 plot object with line plots for outcome trajectories faceted by location


signaturescience/focustools documentation built on July 14, 2022, 3:27 p.m.