enw_example: Load a package example

enw_exampleR Documentation

Load a package example

Description

Loads examples of nowcasts 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

enw_example(
  type = c("nowcast", "preprocessed_observations", "observations", "script")
)

Arguments

type

A character string indicating the example to load. Supported options are

  • "nowcast", for epinowcast() applied to germany_covid19_hosp

  • "preprocessed_observations", for enw_preprocess_data() applied to germany_covid19_hosp

  • "observations", for enw_latest_data() applied to germany_covid19_hosp

  • "script", the code used to generate these examples.

Value

Depending on type, a data.table of the requested output OR the file name(s) to generate these outputs (type = "script")

See Also

Package data sets germany_covid19_hosp

Examples

# Load the nowcast
enw_example(type = "nowcast")

# Load the preprocessed observations
enw_example(type = "preprocessed_observations")

# Load the latest observations
enw_example(type = "observations")

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

seabbs/epinowcast documentation built on Aug. 28, 2024, 12:31 p.m.