Learn R Programming

bnclassify (version 0.4.8)

grain_and_graph: Convert to igraph and gRain.

Description

Convert a bnc_dag to igraph and grain objects.

Usage

as_igraph(x)

as_grain(x)

Arguments

x

The bnc_bn object. The Bayesian network classifier.

Functions

  • as_igraph(): Convert to a graphNEL.

  • as_grain(): Convert to a grain.

Examples

Run this code
data(car)
nb <- bnc('nb', 'class', car, smooth = 1)
# Requires the grain and igraph packages installed
if (FALSE) g <- as_grain(nb)
if (FALSE) gRain::querygrain.grain(g)$buying

Run the code above in your browser using DataLab