graph_from_edgelist_signed: Create a signed graph from an edgelist matrix

View source: R/utils.R

graph_from_edgelist_signedR Documentation

Create a signed graph from an edgelist matrix

Description

Create a signed graph from an edgelist matrix

Usage

graph_from_edgelist_signed(el, signs, directed = FALSE)

Arguments

el

The edgelist, a two column matrix, character or numeric.

signs

vector indicating the sign of edges. Entries must be 1 or -1.

directed

whether to create a directed graph.

Value

a signed network as igraph object

Examples

el <- matrix(c("foo", "bar", "bar", "foobar"), ncol = 2, byrow = TRUE)
signs <- c(-1, 1)
graph_from_edgelist_signed(el, signs)

signnet documentation built on Sept. 9, 2023, 1:06 a.m.