fv_example: Load a package example

View source: R/utils.R

fv_exampleR Documentation

Load a package example

Description

Loads examples of posterior and forecast summaries produced using example scripts. Used to streamline examples, in package tests and to enable users to explore package functionality without needing to install cmdstanr.

Usage

fv_example(strains = 1, type = "posterior")

Arguments

strains

Integer number of strains. Defaults to 2. Current maximum is 2.

type

A character string indicating the example to load. Supported options are "posterior", "forecast", "observations", and "script" which are the output of fv_tidy_posterior(), fv_extract_forecast(), filter_by_availability (with the date argument set to "2021-08-26" applied to the germany_covid19_delta_obs package dataset), and the script used to generate these examples respectively.

Value

A data.table of summarised output

See Also

Package data sets germany_covid19_delta_obs

Examples

# Load the summarised posterior from an example fit of the one strain model
fv_example(strains = 1, type = "posterior")

# Load the summarised forecast from this posterior
fv_example(strains = 1, type = "forecast")

# Load the script used to generate these examples
# Optionally source this script to regenerate the example
readLines(fv_example(strains = 1, type = "script"))

epiforecasts/forecast.vocs documentation built on May 14, 2023, 2 p.m.