Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

graphpkg

Import and export networks from the graph package


Description

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

Usage

## S3 method for class 'graphNEL'
as.bn(x, ..., check.cycles = TRUE)
## S3 method for class 'graphAM'
as.bn(x, ..., check.cycles = TRUE)
## 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.

...

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

## Not run: 
library(graph)
a = bn.fit(hc(learning.test), learning.test)
b = as.graphNEL(a)
c = as.bn(b)
## End(Not run)

bnlearn

Bayesian Network Structure Learning, Parameter Learning and Inference

v4.6.1
GPL (>= 2)
Authors
Marco Scutari [aut, cre], Robert Ness [ctb]
Initial release
2020-09-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.