graph-moralize | R Documentation |
Moralize a directed acyclic graph which means marrying parents and dropping directions.
moralize(object, ...)
## Default S3 method:
moralize(object, result = NULL, ...)
object |
A directed acyclic graph represented either as an |
... |
Additional arguments, currently not used |
result |
The representation of the moralized graph. When NULL the representation will be the same as the input object. |
A moralized graph represented either as an igraph
, a
dense matrix
or a sparse dgCMatrix
.
The workhorse is the moralizeMAT
function.
Søren Højsgaard, sorenh@math.aau.dk
mcs
, junction_tree
, rip
,
ug
, dag
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.