Learn R Programming

multigraph (version 0.91)

frcd: Force directed layout

Description

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

Usage

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

drp

(optional) for weighted networks, drop values less than specified

Additional argument items

scl

(optional and experimental) numerical scalar (x and y) or vector (x, y) of the graph's scale

mov

(optional and experimental) numerical scalar (x and y) or vector (x, y) to move the graph

Value

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

Details

This function was meant as an internal routine for graph visaulization; however, it can be used with the coord option both in multigraph and bmgraph where a random seed is stated by NULL

References

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

See Also

multigraph, bmgraph, stsm, conc

Examples

Run this code
# NOT RUN {
## 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 costumized coordenates
multigraph(arr, coord = coord)

# }

Run the code above in your browser using DataLab