igraphpkg: Import and export networks from the igraph package

Description Usage Arguments Value Author(s) Examples

Description

Convert bn and bn.fit objects to igraph and vice versa.

Usage

1
2
3
4
5
6
## S3 method for class 'igraph'
as.bn(x, ..., check.cycles = TRUE)
## S3 method for class 'bn'
as.igraph(x, ...)
## S3 method for class 'bn.fit'
as.igraph(x, ...)

Arguments

x

an object of class bn, bn.fit, or igraph.

...

extra arguments from the generic method (currently ignored).

check.cycles

a boolean value. If FALSE the returned network will not be checked for cycles.

Value

An object of the relevant class.

Author(s)

Marco Scutari

Examples

1
2
3
4
5
6
## Not run: 
a = bn.fit(hc(learning.test), learning.test)
b = as.igraph(a)
plot(b, edge.arrow.mode = 2L * !igraph::which_mutual(b))
c = as.bn(b)
## End(Not run):

bnlearn documentation built on Sept. 7, 2021, 1:07 a.m.