Learn R Programming

bnRep

The R package bnRep includes the largest repository of Bayesian networks, which were all collected from recent academic literature in a variety of fields! If you are using any Bayesian network from bnRep you should cite:

Leonelli, M. (2025). bnRep: A repository of Bayesian networks from the academic literature. Neurocomputing, 624, 129502.

@Article{,
    title = {bn{R}ep: A repository of {B}ayesian networks from the academic literature},
    author = {Manuele Leonelli},
    journal = {Neurocomputing},
    volume = {624},
    year = {2025},
    pages = {129502}
  }

Go to https://manueleleonelli.shinyapps.io/bnRep/ to explore the repository online!

Contribution

If you are interested in having your Bayesian network included in bnRep you must prepare three objects:

  • the Bayesian network as a bn.fit object (if not created with bnlearn you can always use import functions, such as read.bif());

  • an R file with the same name of the bn.fit object reporting the documentation of the Bayesian network;

  • a vector/excel file with the required details to include in the bnRep_summary object.

You can submit the required objects directly via github (e.g fork/pull), or via email.

If you struggle with any of these steps, please get in touch and I will try to help!

Overview

bnRep includes over 200 Bayesian networks from more than 150 academic publications. It includes discrete, Gaussian and conditional linear Gaussian Bayesian networks, all stored as appropriate bn.fit objects from bnlearn. They can be exported for use to other software (e.g. Phython libraries) using functions from bnlearn such as write.bif(). Recall that in order to plot the associated DAG, one must first convert it to a graph object with bn.net() from the bnlearn package.

Installation

# Install stable version from CRAN:
install.packages("bnRep")

# Or the development version from GitHub:
remotes::install_github("manueleleonelli/bnRep")

Usage

We will use the lawschool Bayesian network as an example. To load it in the environment simply call data(lawschool) and to then plot it (for instance using graphviz.plot from the bnlearn package)

library(bnRep)
library(bnlearn)
library(qgraph)
data("lawschool")
qgraph::qgraph(bn.net(lawschool))

Notice that the function bn.net function must be used in order to plot the network.

Exploring bnRep

bnRep includes two features to explore the Bayesian networks in the repository:

  • bnRep_summary: a dataframe with important details about each network in the repository.

  • bnRep_app: a Shiny app to interactively explore bnRep_summary and filter the networks according to various criteria. The app is also available online at https://manueleleonelli.shinyapps.io/bnRep/.

Here’s the columns of bnRep_summary:

#>  [1] "Name"                   "Type"                   "Structure"             
#>  [4] "Probabilities"          "Graph"                  "Area"                  
#>  [7] "Nodes"                  "Arcs"                   "Parameters"            
#> [10] "Avg. Parents"           "Max Parents"            "Avg. Levels"           
#> [13] "Max Levels"             "Average Markov Blanket" "Year"                  
#> [16] "Journal"                "Reference"

An overview of the Bayesian networks in bnRep

The following plots show some summary statistics of the repository.

#> Warning: package 'ggplot2' was built under R version 4.3.3

Copy Link

Version

Install

install.packages('bnRep')

Monthly Downloads

223

Version

0.0.6

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Manuele Leonelli

Last Published

October 26th, 2025

Functions in bnRep (0.0.6)

BOPfailure3

BOPfailure Bayesian Networks
APSsystem

APSsystem Bayesian Network
GDIpathway2

GDIpathway Bayesian Networks
aerialvehicles

aerialvehicles Bayesian Network
adversarialbehavior

adversarialbehavior Bayesian Network
BOPfailure1

BOPfailure Bayesian Networks
aircrash

aircrash Bayesian Network
airegulation3

airegulation Bayesian Networks
airegulation1

airegulation Bayesian Networks
agropastoral4

agropastoral Bayesian Networks
agropastoral1

agropastoral Bayesian Networks
airegulation2

airegulation Bayesian Networks
agropastoral3

agropastoral Bayesian Networks
agropastoral2

agropastoral Bayesian Networks
agropastoral5

agropastoral Bayesian Networks
algorithms2

algorithms Bayesian Networks
algal1

algal Bayesian Networks
algorithms4

algorithms Bayesian Networks
algorithms5

algorithms Bayesian Networks
beam1

beams Bayesian Network
algalactivity1

algalactivity Bayesian Networks
beatles

beatles Bayesian Network
algal2

algal Bayesian Networks
arcticwaters

arcticwaters Bayesian Network
algorithms6

algorithms Bayesian Networks
blacksea

blacksea Bayesian Network
bankruptcy

bankruptcy Bayesian Network
cardiovascular

cardiovascular Bayesian Network
algorithms3

algorithms Bayesian Networks
bank

bank Bayesian Network
cachexia2

cachexia Bayesian Networks
aspergillus

aspergillus Bayesian Network
augmenting

augmenting Bayesian Network
bnRep

bnRep: A Repository of Bayesian Network Models
blockchain

blockchain Bayesian Network
beam2

beams Bayesian Network
building

building Bayesian Network
conasense

conasense Bayesian Network
concrete1

concrete Bayesian Networks
bnRep_app

Launch the Bayesian Network Viewer App
bullet

bullet Bayesian Network
bnRep_summary

BnRep Summary
algalactivity2

algalactivity Bayesian Networks
catchment

catchment Bayesian Network
concrete4

concrete Bayesian Networks
concrete5

concrete Bayesian Networks
case

case Bayesian Network
consequenceCovid

consequenceCovid Bayesian Network
charleston

charleston Bayesian Network
constructionproductivity

constructionproductivity Bayesian Network
concrete7

concrete Bayesian Networks
chds

chds Bayesian Network
concrete6

concrete Bayesian Networks
coral2

coral Bayesian Networks
cng

cng Bayesian Network
covid2

covid Bayesian Networks
coral1

coral Bayesian Networks
covid1

covid Bayesian Networks
compaction

compaction Bayesian Network
argument

argument Bayesian Network
algorithms1

algorithms Bayesian Networks
asia

asia Bayesian Network
covidrisk

covidrisk Bayesian Network
criminal1

criminal Bayesian Networks
covidtech

covidtech Bayesian Network
covid3

covid Bayesian Networks
concrete3

concrete Bayesian Networks
concrete2

concrete Bayesian Networks
corical

corical Bayesian Network
coral5

coral Bayesian Networks
disputed1

disputed Bayesian Networks
criminal2

criminal Bayesian Networks
criminal3

criminal Bayesian Networks
curacao4

curacao Bayesian Networks
burglar

burglar Bayesian Network
curacao5

curacao Bayesian Networks
emergency

emergency Bayesian Network
covidfear

covidfear Bayesian Network
disputed2

disputed Bayesian Networks
dragline

dragline Bayesian Network
engines

engines Bayesian Network
.onAttach

Message for the User
crimescene

crimescene Bayesian Network
covidtest

covidtest Bayesian Network
criminal4

criminal Bayesian Networks
disputed4

disputed Bayesian Networks
disputed3

disputed Bayesian Networks
electricvehicle

electricvehicle Bayesian Network
electrolysis

electrolysis Bayesian Network
firerisk

firerisk Bayesian Network
earthquake

earthquake Bayesian Network
darktriad

darktriad Bayesian Network
diabetes

ciabetes Bayesian Network
crypto

crypto Bayesian Network
estuary

estuary Bayesian Network
curacao1

curacao Bayesian Networks
ecosystem

ecosystem Bayesian Network
enrollment

enrollment Bayesian Network
flood

flood Bayesian Network
fluids1

fluids Bayesian Networks
foodallergy3

foodallergy Bayesian Networks
foodallergy2

foodallergy Bayesian Networks
fingermarks1

fingermarks Bayesian Networks
fingermarks2

fingermarks Bayesian Networks
fluids3

fluids Bayesian Networks
coral4

coral Bayesian Networks
corticosteroid

corticosteroid Bayesian Network
corrosion

corrosion Bayesian Network
grounding

grounding Bayesian Network
coral3

coral Bayesian Networks
healthinsurance

healthinsurance Bayesian Network
cachexia1

cachexia Bayesian Networks
curacao2

curacao Bayesian Networks
get_network_list

Get the list of available Bayesian network files
ets

ets Bayesian Network
gasifier

gasifier Bayesian Network
expenditure

expenditure Bayesian Network
diagnosis

diagnosis Bayesian Network
curacao3

curacao Bayesian Networks
foodsecurity

foodsecurity Bayesian Network
humanitarian

humanitarian Bayesian Network
foodallergy1

foodallergy Bayesian Networks
forest

forest Bayesian Network
hydraulicsystem

hydraulicsystem Bayesian Network
income

income Bayesian Network
intentionalattacks

intentionalattacks Bayesian Network
intensification

intensification Bayesian Network
inverters

inverters Bayesian Network
fluids2

fluids Bayesian Networks
gonorrhoeae

gonorrhoeae Bayesian Network
lidar

lidar Bayesian Network
liquefaction

liquefaction Bayesian Network
megacities

megacities Bayesian Network
dustexplosion

dustexplosion Bayesian Network
drainage

drainage Bayesian Network
medicaltest

medicaltest Bayesian Network
dioxins

dioxins Bayesian Network
liquidity

liquidity Bayesian Network
fire

fire Bayesian Network
firealarm

firealarm Bayesian Network
lithium

lithium Bayesian Network
orbital

orbital Bayesian Network
oxygen

oxygen Bayesian Network
oildepot

oildepot Bayesian Network
moodstate

moodstate Bayesian Network
metal

metal Bayesian Network
greencredit

greencredit Bayesian Network
onlinerisk

onlinerisk Bayesian Network
poultry

poultry Bayesian Network
nuclearwaste

nuclearwaste Bayesian Network
polymorphic

polymorphic Bayesian Network
nuisancegrowth

nuisancegrowth Bayesian Network
macrophytes

macrophytes Bayesian Network
permaBN

permaBN Bayesian Network
load_network

Load a Bayesian network
phdarticles

phdarticles Bayesian Network
propellant

propellant Bayesian Network
parkinson

parkinson Bayesian Network
lawschool

lawschool Bayesian Network
rainstorm

rainstorm Bayesian Network
lexical

lexical Bayesian Network
perioperative

perioperative Bayesian Network
navigation

navigation Bayesian Network
fundraising

fundraising Bayesian Network
gasexplosion

gasexplosion Bayesian Network
rockquality

rockquality Bayesian Network
ropesegment

ropesegment Bayesian Network
nanomaterials2

nanomaterial Bayesian Networks
rainwater

rainwater Bayesian Network
realestate1

realestate Bayesian Networks
sallyclark

sallyclark Bayesian Network
safespeeds

safespeeds Bayesian Network
rockburst

rockburst Bayesian Network
knowledge

knowledge Bayesian Network
kosterhavet

kosterhavet Bayesian Network
ricci

ricci Bayesian Network
salmonella1

salmonella Bayesian Networks
pneumonia

pneumonia Bayesian Network
project

project Bayesian Network
nanomaterials1

nanomaterial Bayesian Networks
mountaingoat

mountaingoat Bayesian Network
simulation

simulation Bayesian Network
pilot

pilot Bayesian Network
softwarelogs1

softwarelogs Bayesian Networks
softwarelogs4

softwarelogs Bayesian Networks
soil

soil Bayesian Network
salmonella2

salmonella Bayesian Networks
realestate3

realestate Bayesian Networks
soillead

soillead Bayesian Network
soilliquefaction1

soilliquefaction Bayesian Networks
realestate2

realestate Bayesian Networks
redmeat

redmeat Bayesian Network
student1

student Bayesian Networks
projectmanagement

projectmanagement Bayesian Network
softwarelogs2

softwarelogs Bayesian Networks
stocks

stocks Bayesian Network
tbm

tbm Bayesian Network
soilliquefaction4

soilliquefaction Bayesian Networks
softwarelogs3

softwarelogs Bayesian Networks
resilience

resilience Bayesian Network
seismic

seismic Bayesian Network
student2

student Bayesian Networks
soilliquefaction3

soilliquefaction Bayesian Networks
tubercolosis

tubercolosis Bayesian Network
shipping

shipping Bayesian Network
soilliquefaction2

soilliquefaction Bayesian Networks
suffocation

suffocation Bayesian Network
trajectories

trajectories Bayesian Network
windturbine

windturbine Bayesian Network
tastingtea

tastingtea Bayesian Network
wheat

wheat Bayesian Network
turbine1

turbine Bayesian Networks
vaccine

vaccine Bayesian Network
theft2

theft Bayesian Networks
urinary

urinary Bayesian Network
theft1

theft Bayesian Networks
witness

witness Bayesian Network
yangtze

yangtze Bayesian Network
transport

transport Bayesian Network
titanic

titanic Bayesian Network
vessel1

vessel Bayesian Networks
vessel2

vessel Bayesian Networks
twinframework

twinframework Bayesian Network
turbine2

turbine Bayesian Networks
volleyball

volleyball Bayesian Networks
waterlead

waterlead Bayesian Network
accidents

accidents Bayesian Network
GDIpathway1

GDIpathway Bayesian Networks
adhd

adhd Bayesian Network
BOPfailure2

BOPfailure Bayesian Networks