plot_connectivity: Plot the network based on matrix of contact

View source: R/plot_connectivity.R

plot_connectivityR Documentation

Plot the network based on matrix of contact

Description

The function plot_connectivity build an igraph object representing the wards connected by the professionals activities. The function also generate a generic png plot.

Usage

plot_connectivity(
  matContact,
  size,
  vertexcexrate = 3,
  vertexcol = "grey",
  edgewidthrate = 5,
  netobj = FALSE,
  verbose = TRUE
)

Arguments

matContact

Square matrix reporting the average proportion of time spent by professionals of a given ward in the different wards. Sum of rows must be equal to 1. The line width scale for edges will depend on this argument.

size

Vector of population size in each ward (beds, HCWS or sum of both). The size of the nodes/vertex/wards will depend on this argument.

vertexcexrate

Integer, proportional coefficient to adjust vertex names size.

vertexcol

Character, vector defining the colors of vertices in the plot.

edgewidthrate

Integer, proportional coefficient to adjust edge width.

netobj

Logical, define if the function return an igraph oject (TRUE) or a plot (FALSE). Default is FALSE.

verbose

Logical, activate production of details messages.

Value

If netobj is FALSE, the function returns a plot of wards network. If netobj is TRUE, the function returns an igraph object.

Examples


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

matContact <- randomContacts(pop_size_H, ward_names)$contactMat
plot_connectivity(matContact, pop_size_P)


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