plot_static_network {dbnR}R Documentation

Plots a Bayesian network in a hierarchical way

Description

This function calculates the levels of each node and then plots them in a hierarchical layout in visNetwork. Can be used in place of the generic plot function offered by bnlearn for "bn" and "bn.fit" S3 objects.

Usage

plot_static_network(structure)

Arguments

structure

the structure or fit of the network.

Examples


dt_train <- dbnR::motor[200:2500]
net <- bnlearn::mmhc(dt_train)
plot_static_network(net)
fit <- bnlearn::bn.fit(net, dt_train, method = "mle-g")
plot_static_network(fit) # Works for both the structure and the fitted net


[Package dbnR version 0.7.8 Index]