adjMatrix: Adjacency matrix of a graph

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Transforms the “edge matrix” of a graph into the adjacency matrix.

Usage

1

Arguments

A

a square matrix representing the edge matrix of a graph.

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.

Value

E

the adjacency matrix of the graph.

Author(s)

Giovanni M. Marchetti

See Also

edgematrix

Examples

1
2
3
amat <- DAG(y ~ x+z, z~u+v)
E <- edgematrix(amat)
adjMatrix(E)

Example output

Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union


Attaching package: 'ggm'

The following object is masked from 'package:igraph':

    pa

  y x z u v
y 0 0 0 0 0
x 1 0 0 0 0
z 1 0 0 0 0
u 0 0 1 0 0
v 0 0 1 0 0

ggm documentation built on March 26, 2020, 7:49 p.m.

Related to adjMatrix in ggm...