network.layout {network} | R Documentation |
Various functions which generate vertex layouts for the plot.network
visualization routine.
network.layout.circle(d, layout.par) network.layout.fruchtermanreingold(d, layout.par) network.layout.kamadakawai(d, layout.par)
d |
an adjacency matrix, as passed by plot.network . |
layout.par |
a list of parameters. |
Vertex layouts for network visualization pose a difficult problem – there is no single, ``good'' layout algorithm, and many different approaches may be valuable under different circumstances. With this in mind, plot.network
allows for the use of arbitrary vertex layout algorithms via the network.layout.*
family of routines. When called, plot.network
searches for a network.layout
function whose fourth name matches its mode
argument (see plot.network
help for more information); this function is then used to generate the layout for the resulting plot. In addition to the routines documented here, users may add their own layout functions as needed. The requirements for a network.layout
function are as follows:
d
, must be the (dichotomous) graph adjacency matrix;
layout.par
, must be a list of parameters (or NULL
, if no parameters are specified); and
c(2,NROW(d))
, whose rows contain the vertex coordinates.
Other than this, anything goes. (In particular, note that layout.par
could be used to pass additional matrices, if needed.)
The network.layout
functions currently supplied by default are as follows:
NROW(d)
.)NROW(d)^2
.)area*NROW(d)
.)NROW(d)/4
.)NROW(d)^2
.)d
after symmetrizing, capped at sqrt(NROW(d))
.)
A matrix whose rows contain the x,y coordinates of the vertices of d
.
The network.layout
routines shown here are adapted directly from the gplot.layout
routines of the sna
package.
Carter T. Butts buttsc@uci.edu
Butts, C. T. (2008). “network: a Package for Managing Relational Data in R.” Journal of Statistical Software, 24(2). http://www.jstatsoft.org/v24/i02/
Fruchterman, T.M.J. and Reingold, E.M. (1991). “Graph Drawing by Force-directed Placement.” Software - Practice and Experience, 21(11):1129-1164.
Kamada, T. and Kawai, S. (1989). “An Algorithm for Drawing General Undirected Graphs.” Information Processing Letters, 31(1):7-15.