
200 Bayesian Networks: With Examples in R
2. Plot the DAG again, highlighting the nodes and the arcs
that are part of one or more v-structures.
3. Plot the DAG one more time, highlighting the path leading
from Age to Occupation.
4. Plot the conditional probability table of Education.
5. Compare graphically the distributions of Education for
male and female interviewees.
1. > graphviz.plot(dag)
2. > vs <- vstructs(dag, arcs = TRUE)
> hl <- list(nodes = unique(as.character(vs)), arcs = vs)
> graphviz.plot(dag, highlight = hl)
3. > hl <- matrix(c("A", "E", "E", "O"), nc = 2,
+ byrow = TRUE)
> graphviz.plot(dag, highlight = list(arcs = hl))
4. > bn.fit.barchart(bn$E) ...