View source: R/fruchterman_reingold.R
fruchterman_reingold | R Documentation |
This was written and incorporated into the VBLPCM package because the Fruchterman-Reingold routine in the network package only works in two dimensions.
fruchterman_reingold(net, D=2, steps=1000, repulserad=N^D, m=N*(D-1),
volume=N*(D-1))
net |
network object on which to perform Fruchterman-Reingold layout. |
D |
Desired dimension of the space in which to lay out the network. |
steps |
Number of desired iterations. |
repulserad |
The radius at which repulsion and attraction of linked nodes are equal. |
m |
The maximum change in position per iteration. |
volume |
The volume of space within which to position the nodes. |
An N*D matrix of coordinates.
Michael Salter-Townshend
log_like_forces
### 2D example
### load the aids blogs dataset
data(aids)
### perform the Fruchterman-Reingold layout
X<-fruchterman_reingold(aids.net, D=2, steps=1e3)
### plot the results
plot(X)
### 3D example
### load the aids blogs dataset
data(aids)
### perform the Fruchterman-Reingold layout
X<-fruchterman_reingold(aids.net, D=3, steps=1e3)
### Not run
### plot the results in 3D
# library(rgl)
# plot3d(X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.