Learn R Programming

EpiModel (version 0.95)

plot.epiNet.simTrans: Plot Simulations from a Stochastic Network Epidemic Model

Description

This function plots three types of output from a stochastic network model simulated through epiNet.simTrans.

Usage

## S3 method for class 'epiNet.simTrans':
plot(x, type = "sim", sim, at = 1,
  col.inf = FALSE, shp.bip = NULL, zeromarg = TRUE, alpha, lwd,
  plots.joined, ...)

Arguments

x
an EpiModel model object of class epiNet.simTrans.
type
type of plot: type="sim" for epidemic model results, type="network" for a static network plot (plot.network), or type="formation" for network formation statistics.
sim
if type="network", simulation number for network graph.
at
if type="network", time step for network graph.
col.inf
if TRUE and type="network", automatic disease status colors (blue = susceptible, red = infected, , green = recovered).
shp.bip
if type="network", specify shapes in bipartite network for the second mode vertices, with acceptable inputs of "triangle" and "square".
zeromarg
if TRUE and type="network", automatically sets plot margins to 0 on all sides.
alpha
if type="formation", transparency level for lines, where 0 = transparent and 1 = opaque.
lwd
if type="formation", line width for output values.
plots.joined
if TRUE and type="formation", combine all target statistics in one plot, versus one plot per target statistic if FALSE.
...
additional arguments to pass to either plot type.

Details

This generic plot function can produce three types of plots given a stochastic network model simulated through epiNet.simTrans:
  1. Iftype="sim", epidemic model results (e.g., disease prevalence and incidence) may be plotted. In this case, this plotting function wraps theplot.epiICMfunction, as the stochastic epidemiological results are in the same data structure. Consult the help page forplot.epiICMfor all the plotting parameters.
  2. Iftype="network", a static network plot will be generated. A static network plot of a dynamic network of the sort simulated inEpiModelis a cross-sectional extraction of that dynamic network at a specific time point. This plotting function wraps theplot.networkfunction in thenetworkpackage. Consult the help page forplot.networkfor all the plotting parameters. In addition, five plotting parameters specific toEpiModelplots are available:sim,at,col.inf,shp.bip, andzeromarg.
  3. Iftype="formation", summary network statistics related to partnership formation will be plotted. These formation plots are similar to the formation plots for bothepiNet.estandepiNet.simNetobjects. When running aepiNet.simTranssimulation, one must specify there thatsave.stats=TRUE; the plot here will then show the network statistics requested explicitly instat.formula, or use the formation formula set inepiNet.estotherwise. Note, that these network statistics are not saved for independentepiNet.simTranssimulations, since all of the network data, including these statistics, is simulated and saved in the call toepiNet.simNet; one should plot theepiNet.simNetobject in that situation.

See Also

plot.epiICM, plot.network

Examples

Run this code
## See EpiModel Tutorial vignette for examples ##

Run the code above in your browser using DataLab