Learn R Programming

wdnet (version 1.2.3)

adj_to_wdnet: Creates a wdnet object using an adjacency matrix

Description

Creates a wdnet object using an adjacency matrix

Usage

adj_to_wdnet(adj, directed = TRUE, weighted = TRUE, nodegroup, ...)

Value

A wdnet object with the specified adj.

Arguments

adj

An adjacency matrix used to extract edgelist and edgeweight using igraph.

directed

Logical, whether the network is directed (TRUE) or undirected (FALSE). If adj is asymmetric, the network is directed.

weighted

Logical, whether the network is weighted (TRUE) or unweighted (FALSE).

nodegroup

A numeric vector of node groups.

...

Additional components to be added to the wdnet object.

Examples

Run this code
adj <- matrix(c(0, 1, 2, 0), nrow = 2, ncol = 2, byrow = TRUE)
adj_to_wdnet(adj = adj, directed = TRUE, weighted = FALSE)

Run the code above in your browser using DataLab