Learn R Programming

ergm.sign (version 0.1.2)

plot.static.sign: Visualization for Signed Networks

Description

Functions to visualize signed networks in static or dynamic form.

Usage

# S3 method for static.sign
plot(
  x,
  col_pos = "#008000",
  col_neg = "#E3000F",
  neg.lty = 1,
  inv_weights = TRUE,
  coord = NULL,
  ...
)

Value

A plot of the signed network.

Arguments

x

A signed network object of class static.sign.

col_pos

Color for positive edges. Default is 'green3'.

col_neg

Color for negative edges. Default is 'red3'.

neg.lty

Line type for negative edges. Default is "solid". Other options are "dotted" and "dashed".

inv_weights

Logical. If TRUE, edge weights are inverted (1/weights) so positive edges pull nodes closer together. Default is TRUE.

coord

Optional matrix of coordinates for node positions. If NULL, layout is computed using stress majorization.

...

Additional arguments passed to the plot function.

Layout

Uses a force-directed graph layout based on stress majorization, implemented in the graphlayouts package via layout_with_stress(). Similar to Kamada-Kawai, but generally faster and with better results.

Static signed networks

plot.static.sign() visualizes a single (static) signed network.

References

gansner2004graphergm.sign

See Also

UnLayer, layout_with_stress

Examples

Run this code
data("tribes")
plot(tribes, col_pos = "green", col_neg = "red")

Run the code above in your browser using DataLab