Function that provides network dynamic representation (using 'visNetwork') from a 'metanetwork' object with a layout based on a diffusion kernel

vismetaNetwork(
  metanetwork,
  g = NULL,
  beta = 0.1,
  legend = NULL,
  mode = "TL-tsne",
  edge_thrs = NULL,
  layout_metaweb = FALSE,
  nrep_ly = 1,
  flip_coords = FALSE,
  diff_plot_bool = FALSE,
  x_y_range = c(100, 100),
  visNetwork.config = visNetwork.default,
  TL_tsne.config = TL_tsne.default
)

Arguments

metanetwork

object of class metanetwork

g

network (igraph object) to represent, default is metaweb

beta

the diffusion parameter of the diffusion kernel, a positive scalar controlling the vertical squeezing of the network

legend

resolution for the legend, legend resolution must be a coarser resolution than the resolution of g, default is NULL

mode

mode used for layout, 'TL-tsne' for trophic level t-sne. Default is 'TL-tsne'

edge_thrs

if non-null, a numeric (between 0 and 1) indicating an edge threshold for the representation

layout_metaweb

a boolean indicating whether the layout of the metaweb should be used to represent the network to use metaweb layout = T, you need first to compute metaweb layout for this beta value using attach_layout()

nrep_ly

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()

flip_coords

a boolean indicating whether coordinates should be flipped. In that case, y-axis is the trophic level and x-axis is the layout axis

diff_plot_bool

boolean, do not edit by hand

x_y_range

a two dimension numeric vector, indicating dilatation of x,y axis

visNetwork.config

configuration list for visNetwork representation, default is visNetwork.default

TL_tsne.config

configuration list for mode 'TL-tsne', default is TL_tsne.default

Value

object of class 'visNetwork', dynamic representation of the current network

Examples

library(metanetwork)
library(igraph)
data("meta_angola")
## Return htmlwidget
# on angola dataset
meta_angola = attach_layout(meta_angola, beta = 0.05)
#> attaching TL-tsne layout for metaweb_Species
#> 
#>                   beta = 0.05
#> beta = 0.05
#> Epoch: Iteration #100 error is: 907.410775021431
#> Epoch: Iteration #200 error is: 217.139979710306
#> Epoch: Iteration #300 error is: 217.265843383911
vismetaNetwork(meta_angola, beta = 0.05)
#> x_max = 1259.92651522773
#> y_max = 349.199083729064