weighted.adjacency.matrix: Weighted adjacency matrix

View source: R/graph.utility.R

weighted.adjacency.matrixR Documentation

Weighted adjacency matrix

Description

Build a symmetric weighted adjacency matrix (wadj matrix) of a graph.

Usage

weighted.adjacency.matrix(file = "edges.txt")

Arguments

file

name of the plain text file to be read (def. edges). The format of the file is a sequence of rows. Each row corresponds to an edge represented through a pair of vertexes (blank separated) and the weight of the edges. For instance: nodeX nodeY score. The file extension can be plain (".txt") or compressed (".gz").

Value

A named symmetric weighted adjacency matrix of the graph.

Examples

edges <- system.file("extdata/edges.txt.gz", package="HEMDAG");
W <- weighted.adjacency.matrix(file=edges);

marconotaro/HEMDAG documentation built on Nov. 20, 2024, 6:02 p.m.