frcd function

Force directed layout

Force directed layout

A function to compute the graph coordinated system with a force directed layout algorithm

frcd(net, seed = seed, maxiter, drp, scl, mov, ...)

Arguments

  • net: an array representing the network relations
  • seed: (mandatory) the seed of the initial layout (see details)
  • maxiter: (optional) the maximum number of iterations
  • ...: Additional argument items
  • scl: (optional and experimental) numerical scalar (xx and yy) or vector (xx, yy) of the graph's scale
  • mov: (optional and experimental) numerical scalar (xx and yy) or vector (xx, yy) to move the graph
  • drp: (optional) for valued networks, drop values less than specified

Details

This function is meant as an internal routine for graph visualization with a force-directed layout procedure. However, it can be used to set the coordinate system with the coord option in functions multigraph and in bmgraph. In such case, the coordinate system of the graph starts with a random displacement of nodes where NULL in the seed argument implies an initial seed based on the computer clock watch, and the number of iterations in maxiter is 60+n60+n.

Returns

A data frame with a coordinated system with two columns representing the abscissa and the ordinate in a two-dimensional rectangular Cartesian coordinate system.

References

Fruchterman, T.M.J., & Reingold, E.M. Graph drawing by force-directed placement. Software-Practice & Experience, 21(11), 1129-1164. 1991.

Author(s)

Antonio Rivero Ostoic

See Also

multigraph, bmgraph, stsm, conc

Examples

## Create the data: two binary relations among three elements arr <- round( replace( array(runif(18), c(3,3,2)), array(runif(18), c(3,3,2))>.5, 3 ) ) ## Coordinates for the force directed layout with random start coord <- frcd(arr, seed = NULL) ## Plot multigraph with customized coordinates multigraph(arr, coord = coord)
  • Maintainer: Antonio Rivero Ostoic
  • License: GPL-3
  • Last published: 2024-05-14