network.layout {ElectroGraph}R Documentation

network.layout

Description

Given a table of ideal distances and a sociomatrix, calculate the projected coordinates under force-directed placement.

Usage

network.layout(connectivity,
               force.mode=c("fruchterman.reingold","kamada.kawai"),
               layout.dimension=2, 
                                        ego.focus=NULL, 
                                        initial.coordinates = NULL,
               verbose=TRUE)

Arguments

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.

Value

An n-by-(layout.dimension) table of coordinates.

Note

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.

Author(s)

Andrew C. Thomas <act@acthomas.ca>

Examples


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)


[Package ElectroGraph version 0.2.0 Index]