Learn R Programming

ggm (version 2.5.1)

adjMatrix: Adjacency matrix of a graph

Description

Transforms the ``edge matrix'' of a graph into the adjacency matrix.

Usage

adjMatrix(A)

Value

E

the adjacency matrix of the graph.

Arguments

A

a square matrix representing the edge matrix of a graph.

Author

Giovanni M. Marchetti

Details

Given the edge matrix \(A\) of a graph, this can be transformed into an adjacency matrix \(E\) with the formula \(E = (A-I)^T\).

See Also

edgematrix

Examples

Run this code
amat <- DAG(y ~ x+z, z~u+v)
E <- edgematrix(amat)
adjMatrix(E)

Run the code above in your browser using DataLab