net.plot: Network Plot

View source: R/net.plot.R

net.plotR Documentation

Network Plot

Description

Produces network plot where nodes represent treatments and edges represent direct evidence (e.g an RCT) comparing treatments.

Usage

net.plot(
  data,
  node.scale = 5,
  edge.scale = 2,
  flag = NULL,
  study.counts = FALSE,
  label.offset1 = 0,
  label.offset2 = 0,
  graph.scale = TRUE,
  node.lab.cex = 1,
  edge.lab.cex = 1,
  node.colour = "#f69c54",
  edge.colour = "grey",
  edge.lab.colour = "blue",
  flag.edge.colour = "lightpink",
  layout = "layout_in_circle",
  layout.params = NULL
)

Arguments

data

A BUGSnetData object produced by data.prep().

node.scale

Size of the nodes (default = 5)

edge.scale

Thickness of the edges (default = 2).

flag

Used to highlight direct comparisons to particular treatments (optional). Set this value to treatment(s) of interest and it will highlight, in red, all of the edges going into the specified treatment(s).

study.counts

If TRUE, prints the number of studies on each edge.

label.offset1

Node label offset relative to node. Default = 0.

label.offset2

Additional label offset for nodes close to the x axis. Default = 0.

graph.scale

Whether to make edges and nodes proportionally larger with the number of studies/arms. Default is TRUE.

node.lab.cex

Size of node labels

edge.lab.cex

Size of edge labels

node.colour

Node colour (string)

edge.colour

Edge colour (string)

edge.lab.colour

Edge label colour (string)

flag.edge.colour

Color of flagged edges (string)

layout

Specifies how the nodes should be layed out in the graph. Default is "layout_in_circle". See igraph::layout_ for layout options

layout.params

Additional parameters to be passed to the chosen 'layout' function. See igraph::layout_ for more information

See Also

data.prep, igraph::layout_

Examples

data(diabetes.sim)

diabetes.slr <- data.prep(
  arm.data = diabetes.sim, 
  varname.t = "Treatment", 
  varname.s = "Study"
)

# use default settings
net.plot(diabetes.slr)

# Highlight all direct comparisons with Placebo. Adjust node and edge size, centre node labels
net.plot(
  data = diabetes.slr, 
  node.scale = 4, 
  edge.scale = 1.5, 
  flag="Placebo", 
  label.offset1 = 0, 
  label.offset2 = 0
)

audrey-b/BUGSnet documentation built on Feb. 2, 2025, 5:10 p.m.