Learn R Programming

signnet (version 1.1.0)

ggsigned: Plot a signed or complex network

Description

Plot a signed or complex network

Usage

ggsigned(g, type = "signed", attr = NULL, edge_cols = NULL, weights = FALSE)

Value

ggplot2 object

Arguments

g

igraph object. Must have a "sign" edge attribute or an attribute containing "P", "N", "A"

type

character string. either "signed" or "complex"

attr

character string. edge attribute that containing "P", "N", "A" if type="complex"

edge_cols

colors used for negative and positive (and ambivalent) ties. Unnamed vectors are matched in that order.

weights

logical. If TRUE, weights are computed based on sign. Defaults to FALSE

Author

David Schoch

Details

This is a very rudimentary visualization of a signed network. If you are fluent in 'ggraph', you can probably cook up something more sophisticated. The function is thus mostly meant to give a quick overview of the network.

Examples

Run this code
if (FALSE) { # requireNamespace("ggraph", quietly = TRUE)
g <- sample_islands_signed(3, 10, 0.5, 2)
ggsigned(g)
}

Run the code above in your browser using DataLab