graphpkg: Import and export networks from the graph package

Description Usage Arguments Value Note Author(s) Examples

Description

Convert bn and bn.fit objects to graphNEL and graphAM objects and vice versa.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S3 method for class 'graphNEL'
as.bn(x)
## S3 method for class 'graphAM'
as.bn(x)
## S3 method for class 'bn'
as.graphNEL(x)
## S3 method for class 'bn.fit'
as.graphNEL(x)
## S3 method for class 'bn'
as.graphAM(x)
## S3 method for class 'bn.fit'
as.graphAM(x)

Arguments

x

an object of class bn, bn.fit, graphNEL, graphAM.

Value

An object of the relevant class.

Note

The corresponding S4 methods are exported as well, and are just wrappers around the S3 ones. So, for example, both as.graphNEL(x) and as(x, "graphNEL") work and return identical objects.

Author(s)

Marco Scutari

Examples

1
2
3
4
5
6
## Not run: 
library(graph)
a = bn.fit(hc(learning.test), learning.test)
b = as.graphNEL(a)
c = as.bn(b)
## End(Not run)

vspinu/bnlearn documentation built on May 3, 2019, 7:08 p.m.