Plots of value-edged networks.

Share:

Description

Generates a visualization of a value-edged network.

Usage

1
2
3
4
5
plot_network(sociomatrix, threshold = 0.5, save_pdf = FALSE,
  pdf_name = "Test.pdf", output_directory = "./",
  comparison_network = NULL, comparison_names = NULL, seed = NULL,
  white_background = FALSE, show_legend = TRUE, title = "",
  identical_node_positions = FALSE)

Arguments

sociomatrix

A square numeric matrix (socimatrix) with real valued edges (no NA's).

threshold

The threshold for removing edges from the network in order to calculate the positions for the nodes using the futcherman reingold algorithm. The value is multiplied against max(abs(sociomatrix)) to determine the threshold. Defaults to 0.5.

save_pdf

Logical indicating whether the plot should be saved to a PDF.

pdf_name

The name we would like to give to the output file. Be sure to include a ".pdf" extension.

output_directory

The directory where the user would like to output the PDF if save_pdf == TRUE.

comparison_network

An optional argument providing a second square numeric matrix (socimatrix) with real valued edges '(no NA's) to be visually compared to sociomatrix. The second network will be Procrustes transformed so that it appears most similar without chaning hte relativel positions of nodes. Defualts to NULL.

comparison_names

An optional string vector of length two providing titles for each of the two networks to be compared. Defaults to NULL.

seed

Optional argument to set the seed for the network layout algorithm so that plots look the same across multiple runs. Defaults to NULL but can be a positive integer (eg. 12345).

white_background

Defaults to FALSE. If TRUE, then network is plotted on a white background with black lettering.

show_legend

Logical indicating whether a legend with extremal edge values should be shown. Defualts to TRUE.

title

The title we wish to give our plot.

identical_node_positions

Logical indicating whether node positions should be fixed to be the same when comparing networks. Defualts to FALSE.

Examples

1
2
3
4
set.seed(12345)
sociomatrix <- matrix(rnorm(400,0,20),20,20)
colnames(sociomatrix) <- rownames(sociomatrix) <- letters[1:20]
plot_network(sociomatrix)