View source: R/plot_pOutbreak.R
plot_pOutbreak | R Documentation |
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.
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)
trajmwss |
List. Trajectories generated by |
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). |
Igraph plot.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.