library(bnlearn)
<-empty.graph(nodes=c('A','S','E','O','R','T'))
dag<-matrix(c("A", "E", "S", "E", "E", "O", "E", "R", "O", "T", "R", "T"), byrow = TRUE, ncol = 2, dimnames = list(NULL, c("from", "to")))
arcs.setarcs(dag)<-arcs.set
dag
Random/Generated Bayesian network
model:
[A][S][E|A:S][O|E][R|E][T|O:R]
nodes: 6
arcs: 6
undirected arcs: 0
directed arcs: 6
average markov blanket size: 2.67
average neighbourhood size: 2.00
average branching factor: 1.00
generation algorithm: Empty
arcs(dag)
from to
[1,] "A" "E"
[2,] "S" "E"
[3,] "E" "O"
[4,] "E" "R"
[5,] "O" "T"
[6,] "R" "T"
modelstring(dag)
[1] "[A][S][E|A:S][O|E][R|E][T|O:R]"