edge_matrix {gRbase}R Documentation

Coerce dag to edge matrix

Description

A DAG can be represented as a triangular matrix of regression coefficients.

Usage

dag2edge_matrix(object, out = 1)

edge_matrix2dag(edge_matrix)

Arguments

object

A graph, either an igraph object or an adjacency matrix.

out

Format of the output, can be 1, 2, 3 or 4.

edge_matrix

Lower triangular matrix representing a dag

Examples

g <- dag(~x2|x1 + x3|x1:x2 + x4|x3)
dag2edge_matrix(g, out=1)
dag2edge_matrix(g, out=2)
dag2edge_matrix(g, out=3)
dag2edge_matrix(g, out=4)
d2 <- dag(~c|a:b+d:c)
dag2edge_matrix(d2)


[Package gRbase version 2.0.2 Index]