Generates a visualization of a value-edged network.
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)
A square numeric matrix (sociomatrix) with real valued edges (no NA's).
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.
Logical indicating whether the plot should be saved to a PDF.
The name we would like to give to the output file. Be sure to include a ".pdf" extension.
The directory where the user would like to output the PDF if save_pdf == TRUE.
An optional argument providing a second square numeric matrix (sociomatrix) 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 changing the relativel positions of nodes. Defaults to NULL.
An optional string vector of length two providing titles for each of the two networks to be compared. Defaults to NULL.
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).
Defaults to FALSE. If TRUE, then network is plotted on a white background with black lettering.
Logical indicating whether a legend with extremal edge values should be shown. Defaults to TRUE.
The title we wish to give our plot.
Logical indicating whether node positions should be fixed to be the same when comparing networks. Defaults to FALSE.
# NOT RUN {
set.seed(12345)
sociomatrix <- matrix(rnorm(400,0,20),20,20)
colnames(sociomatrix) <- rownames(sociomatrix) <- letters[1:20]
plot_network(sociomatrix)
# }
Run the code above in your browser using DataLab