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

661

Version

0.0.5

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Manuele Leonelli

Last Published

July 23rd, 2025

Functions in bnRep (0.0.5)

agropastoral3

agropastoral Bayesian Networks
agropastoral4

agropastoral Bayesian Networks
agropastoral5

agropastoral Bayesian Networks
algalactivity1

algalactivity Bayesian Networks
aircrash

aircrash Bayesian Network
agropastoral2

agropastoral Bayesian Networks
agropastoral1

agropastoral Bayesian Networks
algalactivity2

algalactivity Bayesian Networks
algal2

algal Bayesian Networks
algal1

algal Bayesian Networks
algorithms3

algorithms Bayesian Networks
argument

argument Bayesian Network
asia

asia Bayesian Network
algorithms4

algorithms Bayesian Networks
aspergillus

aspergillus Bayesian Network
algorithms5

algorithms Bayesian Networks
algorithms6

algorithms Bayesian Networks
arcticwaters

arcticwaters Bayesian Network
bnRep_app

Launch the Bayesian Network Viewer App
blockchain

blockchain Bayesian Network
blacksea

blacksea Bayesian Network
augmenting

augmenting Bayesian Network
bnRep

bnRep: A Repository of Bayesian Network Models
beam2

beams Bayesian Network
algorithms2

algorithms Bayesian Networks
bankruptcy

bankruptcy Bayesian Network
beatles

beatles Bayesian Network
beam1

beams Bayesian Network
catchment

catchment Bayesian Network
charleston

charleston Bayesian Network
bank

bank Bayesian Network
burglar

burglar Bayesian Network
algorithms1

algorithms Bayesian Networks
bullet

bullet Bayesian Network
cachexia2

cachexia Bayesian Networks
building

building Bayesian Network
bnRep_summary

BnRep Summary
cachexia1

cachexia Bayesian Networks
concrete1

concrete Bayesian Networks
conasense

conasense Bayesian Network
concrete6

concrete Bayesian Networks
compaction

compaction Bayesian Network
cardiovascular

cardiovascular Bayesian Network
concrete2

concrete Bayesian Networks
case

case Bayesian Network
coral2

coral Bayesian Networks
chds

chds Bayesian Network
concrete4

concrete Bayesian Networks
concrete3

concrete Bayesian Networks
concrete5

concrete Bayesian Networks
corical

corical Bayesian Network
constructionproductivity

constructionproductivity Bayesian Network
corrosion

corrosion Bayesian Network
coral4

coral Bayesian Networks
coral1

coral Bayesian Networks
coral3

coral Bayesian Networks
cng

cng Bayesian Network
covidtech

covidtech Bayesian Network
consequenceCovid

consequenceCovid Bayesian Network
covid3

covid Bayesian Networks
covid2

covid Bayesian Networks
concrete7

concrete Bayesian Networks
coral5

coral Bayesian Networks
criminal1

criminal Bayesian Networks
crimescene

crimescene Bayesian Network
covidrisk

covidrisk Bayesian Network
criminal3

criminal Bayesian Networks
covidfear

covidfear Bayesian Network
curacao5

curacao Bayesian Networks
criminal2

criminal Bayesian Networks
covidtest

covidtest Bayesian Network
criminal4

criminal Bayesian Networks
crypto

crypto Bayesian Network
curacao1

curacao Bayesian Networks
curacao3

curacao Bayesian Networks
curacao4

curacao Bayesian Networks
diabetes

ciabetes Bayesian Network
curacao2

curacao Bayesian Networks
corticosteroid

corticosteroid Bayesian Network
.onAttach

Message for the User
darktriad

darktriad Bayesian Network
disputed4

disputed Bayesian Networks
covid1

covid Bayesian Networks
disputed3

disputed Bayesian Networks
disputed1

disputed Bayesian Networks
disputed2

disputed Bayesian Networks
diagnosis

diagnosis Bayesian Network
dioxins

dioxins Bayesian Network
dustexplosion

dustexplosion Bayesian Network
earthquake

earthquake Bayesian Network
electrolysis

electrolysis Bayesian Network
dragline

dragline Bayesian Network
emergency

emergency Bayesian Network
ets

ets Bayesian Network
estuary

estuary Bayesian Network
drainage

drainage Bayesian Network
fluids1

fluids Bayesian Networks
engines

engines Bayesian Network
fingermarks1

fingermarks Bayesian Networks
fingermarks2

fingermarks Bayesian Networks
firealarm

firealarm Bayesian Network
foodallergy1

foodallergy Bayesian Networks
foodallergy3

foodallergy Bayesian Networks
flood

flood Bayesian Network
fluids2

fluids Bayesian Networks
ecosystem

ecosystem Bayesian Network
enrollment

enrollment Bayesian Network
electricvehicle

electricvehicle Bayesian Network
expenditure

expenditure Bayesian Network
fire

fire Bayesian Network
foodallergy2

foodallergy Bayesian Networks
firerisk

firerisk Bayesian Network
income

income Bayesian Network
grounding

grounding Bayesian Network
get_network_list

Get the list of available Bayesian network files
gasifier

gasifier Bayesian Network
intensification

intensification Bayesian Network
foodsecurity

foodsecurity Bayesian Network
lawschool

lawschool Bayesian Network
humanitarian

humanitarian Bayesian Network
hydraulicsystem

hydraulicsystem Bayesian Network
lithium

lithium Bayesian Network
liquidity

liquidity Bayesian Network
lidar

lidar Bayesian Network
healthinsurance

healthinsurance Bayesian Network
fluids3

fluids Bayesian Networks
inverters

inverters Bayesian Network
load_network

Load a Bayesian network
intentionalattacks

intentionalattacks Bayesian Network
liquefaction

liquefaction Bayesian Network
gonorrhoeae

gonorrhoeae Bayesian Network
fundraising

fundraising Bayesian Network
knowledge

knowledge Bayesian Network
gasexplosion

gasexplosion Bayesian Network
greencredit

greencredit Bayesian Network
macrophytes

macrophytes Bayesian Network
kosterhavet

kosterhavet Bayesian Network
metal

metal Bayesian Network
mountaingoat

mountaingoat Bayesian Network
moodstate

moodstate Bayesian Network
nanomaterials2

nanomaterial Bayesian Networks
polymorphic

polymorphic Bayesian Network
lexical

lexical Bayesian Network
nuisancegrowth

nuisancegrowth Bayesian Network
nuclearwaste

nuclearwaste Bayesian Network
onlinerisk

onlinerisk Bayesian Network
phdarticles

phdarticles Bayesian Network
oxygen

oxygen Bayesian Network
poultry

poultry Bayesian Network
permaBN

permaBN Bayesian Network
medicaltest

medicaltest Bayesian Network
navigation

navigation Bayesian Network
nanomaterials1

nanomaterial Bayesian Networks
megacities

megacities Bayesian Network
rainstorm

rainstorm Bayesian Network
realestate1

realestate Bayesian Networks
salmonella1

salmonella Bayesian Networks
rainwater

rainwater Bayesian Network
orbital

orbital Bayesian Network
perioperative

perioperative Bayesian Network
propellant

propellant Bayesian Network
parkinson

parkinson Bayesian Network
salmonella2

salmonella Bayesian Networks
oildepot

oildepot Bayesian Network
soilliquefaction3

soilliquefaction Bayesian Networks
soilliquefaction2

soilliquefaction Bayesian Networks
project

project Bayesian Network
pneumonia

pneumonia Bayesian Network
softwarelogs3

softwarelogs Bayesian Networks
safespeeds

safespeeds Bayesian Network
pilot

pilot Bayesian Network
soillead

soillead Bayesian Network
soil

soil Bayesian Network
realestate2

realestate Bayesian Networks
tbm

tbm Bayesian Network
soilliquefaction1

soilliquefaction Bayesian Networks
sallyclark

sallyclark Bayesian Network
redmeat

redmeat Bayesian Network
resilience

resilience Bayesian Network
theft2

theft Bayesian Networks
realestate3

realestate Bayesian Networks
softwarelogs4

softwarelogs Bayesian Networks
seismic

seismic Bayesian Network
theft1

theft Bayesian Networks
soilliquefaction4

soilliquefaction Bayesian Networks
simulation

simulation Bayesian Network
shipping

shipping Bayesian Network
projectmanagement

projectmanagement Bayesian Network
titanic

titanic Bayesian Network
ricci

ricci Bayesian Network
rockquality

rockquality Bayesian Network
student2

student Bayesian Networks
student1

student Bayesian Networks
softwarelogs1

softwarelogs Bayesian Networks
rockburst

rockburst Bayesian Network
turbine1

turbine Bayesian Networks
tastingtea

tastingtea Bayesian Network
twinframework

twinframework Bayesian Network
suffocation

suffocation Bayesian Network
tubercolosis

tubercolosis Bayesian Network
yangtze

yangtze Bayesian Network
turbine2

turbine Bayesian Networks
softwarelogs2

softwarelogs Bayesian Networks
vaccine

vaccine Bayesian Network
ropesegment

ropesegment Bayesian Network
stocks

stocks Bayesian Network
witness

witness Bayesian Network
windturbine

windturbine Bayesian Network
urinary

urinary Bayesian Network
vessel1

vessel Bayesian Networks
vessel2

vessel Bayesian Networks
transport

transport Bayesian Network
trajectories

trajectories Bayesian Network
waterlead

waterlead Bayesian Network
wheat

wheat Bayesian Network
APSsystem

APSsystem Bayesian Network
BOPfailure2

BOPfailure Bayesian Networks
accidents

accidents Bayesian Network
adversarialbehavior

adversarialbehavior Bayesian Network
GDIpathway2

GDIpathway Bayesian Networks
aerialvehicles

aerialvehicles Bayesian Network
GDIpathway1

GDIpathway Bayesian Networks
BOPfailure3

BOPfailure Bayesian Networks
adhd

adhd Bayesian Network
BOPfailure1

BOPfailure Bayesian Networks