plot_pOutbreak: Plot the probability of epidemics per ward

View source: R/plot_pOutbreak.R

plot_pOutbreakR Documentation

Plot the probability of epidemics per ward

Description

plot_pOutbreak returns a network plot of the wards whose colors represent the probability of epidemics. This probability is calculated as the proportion of simulations where at least outb_Thhold cases occurred (including professionals and patients cases). Node size is define by the patient population size. Connection between size depends on values in the contact matrix.

Usage

plot_pOutbreak(trajmwss,
pop_size_P,
matContact,
outb_Thhold = 1,
layout = "with_fr",
vertexsize = 0.5,
vertexlabelsize = 0.03,
edgearrowsize = 0.4,
maxcolors = FALSE,
addtitle = FALSE,
verbose = TRUE)

Arguments

trajmwss

List. Trajectories generated by multisim function.

pop_size_P

Numerical vector. Define patient population sizes.

matContact

Square matrix. Report the proportion of time spent by health care workers in the different wards.

outb_Thhold

Integer. Defines the minimal number of cases requested to define an epidemic (default is 1).

layout

String. Graph layout (details: ? igraph::layout_). Default is "with_fr". Options: "as_star","as_tree","in_circle","nicely","on_grid","on_sphere", "randomly","with_dh","with_fr","with_gem","with_graphopt", "with_kk","with_lgl", "with_mds", "with_sugiyama"

vertexsize

Integer. Defines the nodes/ward size (default is 0.5).

vertexlabelsize

Integer. Defines the nodes/ward names size (default is 0.03).

edgearrowsize

Integer. Defines the edge arrows size (default is 0.4).

maxcolors

Integer. Limit the number of colors displayed in the legend (default is FALSE).

addtitle

Logical. Optional title (default is FALSE).

verbose

Logical. Optional messages (default is TRUE).

Value

Igraph plot.

Examples

data("toydata")
list2env(toydata,envir=.GlobalEnv)
gdata <- build_gdata()

model <- mwss(ward_names, pop_size_P, pop_size_H, nVisits, LS, gdata, tSim = 30)
results <- multisim(model, 5, ward_names)

matContact <- randomContacts(pop_size_H, ward_names)$contactMat
plot_pOutbreak(results,
pop_size_P,
matContact,
outb_Thhold = 1,
layout = "nicely",
vertexsize = 0.5,
vertexlabelsize = 0.03,
edgearrowsize = 0.4,
maxcolors = FALSE,
addtitle = TRUE,
verbose = FALSE)


MESuRS-Lab/mwss documentation built on Sept. 12, 2023, 12:08 a.m.