vis.net: Network vizualisation

View source: R/vis.net.R

vis.netR Documentation

Network vizualisation

Description

This function draw network.

Usage

vis.net(
  m,
  df,
  id,
  shape = NULL,
  size = NULL,
  color = NULL,
  label = NULL,
  n.col1 = "blue",
  n.col2 = "red",
  n.size = 1,
  e.width = 1,
  background = NULL,
  solver = NULL,
  n.shape = NULL,
  viewer = FALSE
)

Arguments

m

A square adjacency matrix.

df

A data frame of node attributes.

id

A string or integer indicating the column in the data frame with nodes ids.

shape

A string or integer indicating the column in the data frame according to the shape nodes must have.

size

A string or integer indicating the column in the data frame according to the size nodes must have.

color

A string or integer indicating the column in the data frame according to the color nodes must have.

label

A string or integer indicating the column in the data frame with the labels to use.

n.col1

A string indicating the first color value with which to start the color gradiant.

n.col2

A string indicating the last color value with which to end the color gradiant.

n.size

An integer indicating the size of nodes.

e.width

An integer indicating the width of edges.

background

A string of html color code.

solver

A string indicating the spatialization solver to use among the following options: 'barnesHut', 'repulsion', 'hierarchicalRepulsion', 'forceAtlas2Based'.

n.shape

An optional string vector if you want to set nodes' shapes. It must be unique values of same length as argument df in shape column.

viewer

A boolean indicating if plots must be displayed in R Studio viewer.

Value

The network representation in your browser.

Author(s)

Sebastian Sosa, Jérôme Pansanel

Examples

sim.df= met.eigen(sim.m,sim.df)
head(sim.df)
vis.net(sim.m, sim.df, id = 'id', shape = 'sex', n.shape = c('circle', 'triangle'),
  size = 'eigen', color = 'age')

SebastianSosa/ant documentation built on Sept. 23, 2023, 7:06 a.m.