Moralize a directed acyclic graph

Description

Moralize a directed acyclic graph which means marrying parents and dropping directions.

Usage

1
2
3
4
moralize(object, ...)

## Default S3 method:
moralize(object, result = NULL, ...)

Arguments

object

A directed acyclic graph represented either as a graphNEL object, an igraph, a (dense) matrix, a (sparse) dgCMatrix.

result

The representation of the moralized graph. When NULL the representation will be the same as the input object.

...

Additional arguments, currently not used

Value

A moralized graph represented either as a graphNEL, a dense matrix or a sparse dgCMatrix.

Note

The workhorse is the moralizeMAT function.

Author(s)

Søren Højsgaard, sorenh@math.aau.dk

See Also

mcs, jTree, rip, ug, dag

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
daG <- dag(~me+ve,~me+al,~ve+al,~al+an,~al+st,~an+st)
moralize(daG)

daG <- dag(~me+ve,~me+al,~ve+al,~al+an,~al+st,~an+st, result="matrix")
moralizeMAT(daG)

if (require(igraph)){
M <- matrix(c(1,2,3,3), nrow=2)
G <- graph.edgelist(M)
G
V(G)$name
moralize(G)
}

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.