Function to represent difference between two networks belonging to a metanetwork with specific layout ('TL-tsne' or group 'TL-tsne') using either 'ggnet' or 'visNetwork' visualisation. This function represent the difference between g1 and g2 (g1-g2).
diff_plot(
metanetwork,
g1,
g2,
beta = 0.1,
mode = "TL-tsne",
vis_tool = "ggnet",
edge_thrs = NULL,
layout_metaweb = FALSE,
flip_coords = FALSE,
alpha_per_group = NULL,
alpha_per_node = NULL,
TL_tsne.config = TL_tsne.default,
nrep_ly = 1,
ggnet.config = ggnet.default,
visNetwork.config = visNetwork.default
)an object of class ggplot or visNetwork, representation of the difference network
object of class 'metanetwork'
network (of class 'igraph') of metanetwork
network (of class 'igraph') of metanetwork
the diffusion parameter of the diffusion kernel, a positive scalar controlling the squeezing of the network
mode used for layout, either 'TL-tsne' or 'group-TL-tsne' (see attach_layout()). Default is 'TL-tsne'
a character indicating the visualisation tool, either 'ggnet' or visNetwork
if non-null, a numeric (between 0 and 1) indicating an edge threshold for the representation
a boolean indicating whether the layout of the metaweb should be used to represent the difference network.
to use metaweb layout = T, you need first to compute 'TL-tsne' layout for the metaweb for this beta value using attach_layout()
a boolean indicating whether coordinates should be flipped. In that case, y-axis is the trophic level and x-axis is the layout axis
controlling alpha per group (only for 'ggnet' vis), a list of format
list(resolutions = "XX",groups = XX,alpha_focal = XX,alpha_hidden = XX), see example
controlling alpha per node (only for 'ggnet' vis), a list of format
list(nodes = XX,alpha_focal = XX,alpha_hidden = XX), see example
configuration list for mode 'TL-tsne', default is TL_tsne.default
If several layouts for this beta value are attached to the metaweb
(if layout_metaweb = T), index of the layout to use, see attach_layout()
configuration list for ggnet representation, default is ggnet.default
configuration list for visNetwork representation, default is visNetwork.default
attach_layout()
#on Angola dataset
library(igraph)
library(metanetwork)
data(meta_angola)
diff_plot(g1 = meta_angola$X2003,g2 = meta_angola$X1986,metanetwork = meta_angola,
beta = 0.05)
Run the code above in your browser using DataLab