f.adj_matrix: Build an adjacency matrix from a graph.

View source: R/graph-functions.R

f.adj_matrixR Documentation

Build an adjacency matrix from a graph.

Description

Construct the adjacency matrix implied by the directed edges stored in the graph object.

Usage

f.adj_matrix(graph)

Arguments

graph

A graph object generated by the make.graph() function.

Value

An adjacency matrix of the graph.

Examples

graph <- make.graph(vertices=c('A','M','L','Y','X'),
bi_edges=list(c('A','Y')),
di_edges=list(c('X','A'), c('X','M'), c('X','L'),
c('X','Y'), c('M','Y'), c('A','M'), c('A','L'), c('M','L'), c('L','Y')))
f.adj_matrix(graph)

flexCausal documentation built on March 29, 2026, 5:08 p.m.