plot_nosoHazard: Plot daily risk of nosocomial infection per patient

View source: R/plot_nosoHazard.R

plot_nosoHazardR Documentation

Plot daily risk of nosocomial infection per patient

Description

plot_nosoHazard function returns a network plot of the wards whose colors represent the average daily risk of contracting a nosocomial infection for one patient of the ward . This average daily risk is calculated by dividing the average daily incidence by the average daily turnover (number of beds divided by the average length of stay). Associated risk-colors grade from white to red.

Usage

plot_nosoHazard(
       trajmwss, ward_names, pop_size_P, LS,
       matContact, layout = "with_fr", vertexsize = 0.5,
       vertexlabelsize = 0.03, edgearrowsize = 0.4, addtitle = FALSE,
       maxcolors = FALSE, verbose = TRUE)

Arguments

trajmwss

list of trajectories generated by multisim function

ward_names

string vector of ward names

pop_size_P

numerical vector of patient population sizes

LS

numerical vector of length of stay

matContact

Matrix reporting the proportion of time spent by health care workers in the different wards.

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).

addtitle

logical for optional title. Default is FALSE,

maxcolors

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

verbose

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_nosoHazard(results,
                ward_names,
                pop_size_P,
                LS,
                matContact,
                layout = "nicely",
                vertexsize = 0.5,
                vertexlabelsize = 0.03,
                edgearrowsize = 0.4,
                addtitle = TRUE,
                maxcolors = FALSE,
                verbose = FALSE)


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