network.layout {ElectroGraph} | R Documentation |
Given a table of ideal distances and a sociomatrix, calculate the projected coordinates under force-directed placement.
network.layout(connectivity, force.mode=c("fruchterman.reingold","kamada.kawai"), layout.dimension=2, ego.focus=NULL, initial.coordinates = NULL, verbose=TRUE)
connectivity |
An n-by-n matrix containing the values of the connective forces among the n individuals (inverse distance). |
force.mode |
Either of the above two methods for force-directed placement. |
layout.dimension |
Of 1, 2 or 3, the dimension of the output coordinates. |
ego.focus |
A vector of node indices for which priority should be made highest for their relative distances. |
initial.coordinates |
If specified, the algorithm will begin at the specified coordinates rather than a randomly generated set. |
verbose |
If TRUE, display additional information while running. |
An n-by-(layout.dimension) table of coordinates.
The algorithm can technically handle any dimensionality in the data, and is written for expandability; however, in its current form, as only two-dimensional plotting is supported in the package (and three-dimensional visualization the maximum supported by the human brain) the layout dimension is restricted in this routine.
Andrew C. Thomas <act@acthomas.ca>
latt <- cbind(rep(1:5,5),sort(rep(1:5,5))) latt.e <- electrograph (make.sociomatrix.from.lattice(latt)$sociomatrix) latt.coords <- network.layout(1/latt.e$geodesic) print(latt.coords)