plot_static_network: Plots a Bayesian network in a hierarchical way

View source: R/dbn_visualization.R

plot_static_networkR 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


dbnR documentation built on Oct. 5, 2022, 1:07 a.m.