bbn.network.diagram()
generates a network diagram from a specified Bayesian Belief Network (BBN
),
allowing for the visualization of the relationships and interactions between nodes
.
bbn.network.diagram(
bbn.network,
font.size = 0.7,
arrow.size = 4,
arrange = layout_on_sphere
)
A plot of the network diagram, illustrating the interactions (both positive and negative) between nodes
.
A dataframe, with a first column called id
that consists of an s
and a 2 digit number relating to the node
number.
The second column called node.type
is an integer
value from 1-4.
This sets the colour of the node
in the network (sticking to a maximum of four colours).
The third column is the same as the first column in the standard BBN
interaction matrix or dataframe, other than it is titled node.name
.
It is important to use these column names (including capitals and dot notation).
The remainder of the columns are exactly as the standard BBN
interaction matrix or dataframe.
Changes the font in the figure produced. Default = 0.7.
The value here is a multiplier of the default font size used in the igraph
package and does not correspond to the font.size
argument in bbn.timeseries
.
Changes the size of the arrows. Default = 4. Note, sizes do vary based on interaction strength, so this is a multiplier for visualisation purposes. Negative interactions are shown by red arrows, and positive interactions by black arrows.
this describes how the final diagram looks.
Default is layout_on_sphere
but layout_on_grid
provides the same layout as in bbn.visualise
and ensures nodes
are structured in the order specified in the network.
Other layouts, including layout_on_sphere
are more randomly determined, and better/clearer diagrams may occur if you run these multiple times.
Other options are from the igraph package:
layout.sphere
layout.circle
layout.random
layout.fruchterman.reingold
The diagram is created using edge
and node
data derived from the BBN
, with edges
representing
interactions (positive or negative) between nodes
.
bbn.network.diagram()
visualises all nodes
and interactions in a network, in a similar manner to bbn.visualise
, other than this is the full network.
data(my_network)
bbn.network.diagram(bbn.network = my_network, font.size=0.7,
arrow.size=4, arrange = layout_on_sphere)
Run the code above in your browser using DataLab