Learn R Programming

gRbase (version 1.7-1)

moralize: Moralize a directed acyclic graph

Description

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

Usage

moralize(object, ...)
## S3 method for class 'default':
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 'matrix' or a sparse 'dgCMatrix'.

See Also

mcs jTree rip ug, dag

Examples

Run this code
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)

Run the code above in your browser using DataLab