Learn R Programming

dbnR (version 0.7.1)

plot_network: Plots a Bayesian networks in a hierarchical way

Description

Calculates the levels of each node and then plots them in a hierarchical layout in visNetwork.

Usage

plot_network(structure)

Arguments

structure

the structure or fit of the network.

Examples

Run this code
# NOT RUN {
dt_train <- dbnR::motor[200:2500]
net <- bnlearn::mmhc(dt_train)
plot_network(net)
fit <- bnlearn::bn.fit(net, dt_train, method = "mle")
plot_network(fit) # Works for both the structure and the fitted net
# }

Run the code above in your browser using DataLab