layout.forceatlas2: ForceAtlas2 layout

Description Usage Arguments Value Examples

Description

ForceAtlas2 layout

Usage

1
2
3
4
layout.forceatlas2(graph, directed = TRUE, iterations = 100,
  linlog = FALSE, pos = NULL, nohubs = FALSE, k = 400, gravity = 1,
  ks = 0.1, ksmax = 10, delta = 1, center = NULL, tolerate = 0.1,
  dim = 2, plotstep = 10, plotlabels = TRUE)

Arguments

graph

An igraph network or a data frame of three columns: source, target, and weights.

directed

Logical. TRUE if the network is directed. Ignored if graph is an igraph object.

iterations

Number of iterations to be performed.

linlog

Logical. If TRUE the algorithm uses logarithmic attraction force 'F <- log (1+F)'

pos

A data frame or matrix (NumberOfNodes x dimension) of the initial locations of points. If NULL the initial positions are random.

nohubs

Logical. If TRUE nodes with high indegree have more central position than nodes with outdegree (for directed graphs).

k

Is the repel constant: the greater the constant k the stronger the repulsion force between points.

gravity

Gravity constant: indicates how strongly the nodes should be attracted to the center of gravity.

ks

Speed constant: the greater the value of 'ks' the more movement the nodes make under the acting forces.

ksmax

Limits the speed from above.

delta

Modify attraction force, the weights are raised to the power of 'delta'

center

Center of gravity.

dim

Dimension of the positions.

plotstep

is the frequency of plotting intermediate iterations.

plotlabels

Logical. If TRUE the labels should be included in the intermediate interations plot

tolerance

Tolerance to swinging constant.

Value

When graph is an igraph object, the function returns a matrix with the positions. If graph is a data frame, this is a data frame with the names of the nodes and the positions.

Examples

1
2
3
4
library(igraph)
g <- graph.ring(50)
layout <- layout.forceatlas2(g, iterations=3000, plotstep=100)
plot(g, layout=layout)

analyxcompany/ForceAtlas2 documentation built on May 12, 2019, 2:40 a.m.