as_adj_weighted: weighted dense adjacency matrix

View source: R/graph_structures.R

as_adj_weightedR Documentation

weighted dense adjacency matrix

Description

returns the weighted adjacency matrix in dense format

Usage

as_adj_weighted(g, attr = NULL)

Arguments

g

An igraph object

attr

Either NULL or a character string giving an edge attribute name. If NULL a traditional adjacency matrix is returned. If not NULL then the values of the given edge attribute are included in the adjacency matrix.

Details

This method is faster than as_adj from igraph if you need the weighted adjacency matrix in dense format

Value

Numeric matrix

Author(s)

David Schoch

Examples

library(igraph)
g <- sample_gnp(10, 0.2)
E(g)$weight <- runif(ecount(g))
as_adj_weighted(g, attr = "weight")

schochastics/netUtils documentation built on Oct. 17, 2024, 10:45 a.m.