forked from ParkerICI/vite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayout_forceatlas2.Rd
65 lines (57 loc) · 2.5 KB
/
layout_forceatlas2.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/forceatlas2.R
\name{layout_forceatlas2}
\alias{layout_forceatlas2}
\title{ForceAtlas2 force-directed layout}
\usage{
layout_forceatlas2(
G,
ew.influence = 1,
kgrav = 1,
iter = 1000,
prevent.overlap = FALSE,
fixed = NULL,
stopping.tolerance = 0.001,
barnes.hut = FALSE
)
}
\arguments{
\item{G}{The input \code{igraph} object. The graph must have an edge attribute named \code{weight}, representing edge weights}
\item{ew.influence}{Edge weight influence. The edge weights are set to \code{edge.weight ^ ew.influence} before the
calculation (see original ForceAtlas2 publication)}
\item{kgrav}{The gravity constant. Higher values will result in more compact graphs (see original ForceAtlas2 publication)}
\item{iter}{Maximum number of iterations. The algorithm will stop after this
many iterations, or when the average displacement of the nodes between two
iterations is less than the \code{stopping.tolerance} threshold (see below)}
\item{prevent.overlap}{Set this option to \code{TRUE} to prevent the nodes
from overlapping (see ForceAtlas2 description)}
\item{fixed}{A boolean vector of length equal to the number of nodes in the
graph which specifies which nodes, need to be held in a fixed
position. If this is \code{NULL} (default), no nodes are held fixed}
\item{stopping.tolerance}{The algorithm will stop after either \code{iter}
number of iterations, or when the average displacement of the nodes between
two iterations is less than this threshold}
\item{barnes.hut}{Whether to use the Barnes-Hut approximation for speeding up
the calculations when dealing with large graphs. This option is
automatically set to true when the graph has more than 2000 nodes}
}
\value{
this function returns a list with three elements
\itemize{
\item{\code{lay}}: a numeric matrix with two columns containing the x and y coordinates of each node in the final
layout
\item{\code{avg.displ}}: a numeric vector containing the average displacement of the vertices at each iteration
\item{\code{max.displ}}: a numeric vector containing the maximum displacement between all the vertices after
each iteration
}
}
\description{
ForceAtlas2 force-directed layout
}
\references{
\url{http://gephi.github.io}
Jacomy M1, Venturini T, Heymann S, Bastian M. ForceAtlas2, a
continuous graph layout algorithm for handy network visualization designed
for the Gephi software. PLoS One. 2014 Jun 10;9(6):e98679. doi:
10.1371/journal.pone.0098679
}