make_epi_plot_data: Create data for plotting from EpiModel simulation

Description Usage Arguments Details Value Examples

View source: R/make_epi_plot_data.R

Description

Create data for plotting from EpiModel simulation

Usage

1
make_epi_plot_data(dat_obj, plot_params)

Arguments

dat_obj

The dat object from an EpiModel Simulation

plot_params

A list containing information about the information to be plotted and how to extract this information from the dat object. See details for more information.

Details

The 'plot_params' object contains at least two elements. The first is the 'plot_name' argument which is the formal name of the measure you wish to plot. The other 'name' which is the name of the variable that will be as it appears in the epi list object (dat$epi).

If the epi measure you wish to plot must be constructed, two additional arguments must be given, and the 'name' argument can be chosen by the user. While 'name' can be set to any string, the user should make sure this name matches any target they wish to match.

The first additional argument that must be specified is the 'vars'. This argument gives the names of the epi measures currently stored inside of epi that will be used to construct the epi measure of interest. As an example, if the measure of interest was prevalence, the 'vars' argument would be 'c("num.", "num.i.")' because the number and number of individuals infected could be used to construct prevalence.

The second additional argument that must be specified is the 'FUN' argument. This argument gives the function that will calculate the epi measure of interest from the 'vars' arguments given. Note that this function should take a number of arguments that matches the length of 'vars'. The function should also take arguments in the order that they appear in 'vars'. Continuing our example of prevalence, the function we would specify would be 'function(x, y) = y / x'.

Value

A list with the needed objects to be passed to the plot_epi function.

Examples

1
# see vignette

adam-s-elder/EpiModelWHAMPDX documentation built on June 21, 2021, 5:31 a.m.